Skip to content

Commit

Permalink
Merge branch 'feature/stable-cadence' into supun/contract-update-vali…
Browse files Browse the repository at this point in the history
…dator-2
  • Loading branch information
turbolent authored Feb 23, 2024
2 parents d08f31c + 9bcc862 commit ffdf326
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
32 changes: 30 additions & 2 deletions cmd/util/ledger/migrations/cadence_values_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func checkMigratedPayloads(

storageMap := mr.Storage.GetStorageMap(address, common.PathDomainStorage.Identifier(), false)
require.NotNil(t, storageMap)
require.Equal(t, 11, int(storageMap.Count()))
require.Equal(t, 12, int(storageMap.Count()))

iterator := storageMap.Iterator(mr.Interpreter)

Expand Down Expand Up @@ -240,7 +240,7 @@ func checkMigratedPayloads(
common.CompositeKindResource,
[]interpreter.CompositeField{
{
Value: interpreter.NewUnmeteredUInt64Value(1369094286720630784),
Value: interpreter.NewUnmeteredUInt64Value(360287970189639680),
Name: "uuid",
},
},
Expand All @@ -255,6 +255,12 @@ func checkMigratedPayloads(
),
),

interpreter.NewUnmeteredCapabilityValue(
interpreter.NewUnmeteredUInt64Value(2),
interpreter.NewAddressValue(nil, address),
interpreter.NewReferenceStaticType(nil, entitlementAuthorization(), rResourceType),
),

interpreter.NewDictionaryValue(
mr.Interpreter,
interpreter.EmptyLocationRange,
Expand Down Expand Up @@ -499,6 +505,28 @@ func checkReporters(
common.PathDomainPublic,
),

// untyped capability
capConsPathCapabilityMigrationEntry{
AccountAddress: address,
AddressPath: interpreter.AddressPath{
Address: address,
Path: interpreter.NewUnmeteredPathValue(
common.PathDomainPublic,
"linkR",
),
},
BorrowType: interpreter.NewReferenceStaticType(
nil,
entitlementAuthorization(),
rResourceType,
),
},
newCadenceValueMigrationReportEntry(
"CapabilityValueMigration",
"untyped_capability",
common.PathDomainStorage,
),

// Account-typed keys in dictionary
acctTypedDictKeyMigrationReportEntry,
acctTypedDictKeyMigrationReportEntry,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ transaction {

// Capabilities and links
acct.save(<- Test.createR(), to: /storage/r)
var cap = acct.link<&Test.R>(/public/linkR, target: /storage/r)
acct.save(cap, to: /storage/capability)

// Typed capability
var cap1: Capability<&Test.R>? = acct.link<&Test.R>(/public/linkR, target: /storage/r)
acct.save(cap1, to: /storage/capability)

// Untyped capability
var cap2: Capability = acct.getCapability(/public/linkR)
acct.save(cap2, to: /storage/untyped_capability)

// account-typed keys in dictionary
acct.save(
Expand Down

0 comments on commit ffdf326

Please sign in to comment.