Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
SupunS committed Aug 9, 2024
1 parent 0fc0f64 commit f28b494
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/util/ledger/migrations/cadence.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
_ "embed"
"fmt"

"github.com/rs/zerolog"

"github.com/onflow/cadence/migrations/capcons"
Expand Down Expand Up @@ -370,13 +371,13 @@ func (m *IssueStorageCapConMigration) issueAccountCapabilities(
}

borrowStaticType := capability.BorrowType
path := capability.Path.Identifier

if borrowStaticType == nil {
reporter.MissingBorrowType(address, addressPath)

// If the borrow type is missing, treat it as `AnyStruct` or `AnyResource`.
// To determine whether it is a resource, read the target path.
path := capability.Path.Identifier
value := storageMap.ReadValue(nil, interpreter.StringStorageMapKey(path))

assumedBorrowType := interpreter.PrimitiveStaticTypeAnyStruct
Expand Down

0 comments on commit f28b494

Please sign in to comment.