From 103ea9eabec28d7ce609a6bd5b6c59f15366bd3e Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Wed, 21 Aug 2024 11:58:48 -0700 Subject: [PATCH 1/2] Update to cadence v1.0.0-preview.49 --- go.mod | 4 ++-- go.sum | 8 ++++---- insecure/go.mod | 4 ++-- insecure/go.sum | 8 ++++---- integration/go.mod | 4 ++-- integration/go.sum | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 5b15c5135a0..6aea81a935e 100644 --- a/go.mod +++ b/go.mod @@ -47,8 +47,8 @@ require ( github.com/multiformats/go-multiaddr v0.12.2 github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multihash v0.2.3 - github.com/onflow/atree v0.8.0-rc.5 - github.com/onflow/cadence v1.0.0-preview.48 + github.com/onflow/atree v0.8.0-rc.6 + github.com/onflow/cadence v1.0.0-preview.49 github.com/onflow/crypto v0.25.2 github.com/onflow/flow v0.3.4 github.com/onflow/flow-core-contracts/lib/go/contracts v1.3.1 diff --git a/go.sum b/go.sum index 3efc952697f..a044533aeec 100644 --- a/go.sum +++ b/go.sum @@ -2163,13 +2163,13 @@ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:v github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs95K7IYdIYRnNcYQGf4nbF/uuJ0tHf4DRuM= -github.com/onflow/atree v0.8.0-rc.5 h1:1sU+c6UfDzq/EjM8nTw4EI8GvEMarcxkWkJKy6piFSY= -github.com/onflow/atree v0.8.0-rc.5/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= +github.com/onflow/atree v0.8.0-rc.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA= +github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= github.com/onflow/boxo v0.0.0-20240201202436-f2477b92f483 h1:LpiQhTAfM9CAmNVEs0n//cBBgCg+vJSiIxTHYUklZ84= github.com/onflow/boxo v0.0.0-20240201202436-f2477b92f483/go.mod h1:pIZgTWdm3k3pLF9Uq6MB8JEcW07UDwNJjlXW1HELW80= github.com/onflow/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8= -github.com/onflow/cadence v1.0.0-preview.48 h1:WkgU0z6H/oRe44kLL6OO+wkGeKULWChoCT8i7sgiWdg= -github.com/onflow/cadence v1.0.0-preview.48/go.mod h1:BCoenp1TYp+SmG7FGWStjehvvzcvNQ3xvpK5rkthq3Y= +github.com/onflow/cadence v1.0.0-preview.49 h1:MXy6qAtFyRSnqSVKpDkh2J1sb2JEryJoYy/5qsaixlw= +github.com/onflow/cadence v1.0.0-preview.49/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU= github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns= github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY= diff --git a/insecure/go.mod b/insecure/go.mod index 34f6b21f736..6e51ad8819b 100644 --- a/insecure/go.mod +++ b/insecure/go.mod @@ -201,8 +201,8 @@ require ( github.com/multiformats/go-multistream v0.5.0 // indirect github.com/multiformats/go-varint v0.0.7 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onflow/atree v0.8.0-rc.5 // indirect - github.com/onflow/cadence v1.0.0-preview.48 // indirect + github.com/onflow/atree v0.8.0-rc.6 // indirect + github.com/onflow/cadence v1.0.0-preview.49 // indirect github.com/onflow/flow-core-contracts/lib/go/contracts v1.3.1 // indirect github.com/onflow/flow-core-contracts/lib/go/templates v1.3.1 // indirect github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect diff --git a/insecure/go.sum b/insecure/go.sum index 57a14601daa..2697314390f 100644 --- a/insecure/go.sum +++ b/insecure/go.sum @@ -2155,11 +2155,11 @@ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:v github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs95K7IYdIYRnNcYQGf4nbF/uuJ0tHf4DRuM= -github.com/onflow/atree v0.8.0-rc.5 h1:1sU+c6UfDzq/EjM8nTw4EI8GvEMarcxkWkJKy6piFSY= -github.com/onflow/atree v0.8.0-rc.5/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= +github.com/onflow/atree v0.8.0-rc.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA= +github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= github.com/onflow/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8= -github.com/onflow/cadence v1.0.0-preview.48 h1:WkgU0z6H/oRe44kLL6OO+wkGeKULWChoCT8i7sgiWdg= -github.com/onflow/cadence v1.0.0-preview.48/go.mod h1:BCoenp1TYp+SmG7FGWStjehvvzcvNQ3xvpK5rkthq3Y= +github.com/onflow/cadence v1.0.0-preview.49 h1:MXy6qAtFyRSnqSVKpDkh2J1sb2JEryJoYy/5qsaixlw= +github.com/onflow/cadence v1.0.0-preview.49/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU= github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns= github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY= diff --git a/integration/go.mod b/integration/go.mod index 0bb57362a79..de817fc26e8 100644 --- a/integration/go.mod +++ b/integration/go.mod @@ -20,7 +20,7 @@ require ( github.com/ipfs/go-ds-badger2 v0.1.3 github.com/ipfs/go-ds-pebble v0.3.1 github.com/libp2p/go-libp2p v0.32.2 - github.com/onflow/cadence v1.0.0-preview.48 + github.com/onflow/cadence v1.0.0-preview.49 github.com/onflow/crypto v0.25.2 github.com/onflow/flow-core-contracts/lib/go/contracts v1.3.1 github.com/onflow/flow-core-contracts/lib/go/templates v1.3.1 @@ -244,7 +244,7 @@ require ( github.com/multiformats/go-multistream v0.5.0 // indirect github.com/multiformats/go-varint v0.0.7 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onflow/atree v0.8.0-rc.5 // indirect + github.com/onflow/atree v0.8.0-rc.6 // indirect github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect github.com/onflow/flow-ft/lib/go/templates v1.0.0 // indirect github.com/onflow/flow-nft/lib/go/contracts v1.2.1 // indirect diff --git a/integration/go.sum b/integration/go.sum index c0e79822ae7..852d3631422 100644 --- a/integration/go.sum +++ b/integration/go.sum @@ -2139,11 +2139,11 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs95K7IYdIYRnNcYQGf4nbF/uuJ0tHf4DRuM= -github.com/onflow/atree v0.8.0-rc.5 h1:1sU+c6UfDzq/EjM8nTw4EI8GvEMarcxkWkJKy6piFSY= -github.com/onflow/atree v0.8.0-rc.5/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= +github.com/onflow/atree v0.8.0-rc.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA= +github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= github.com/onflow/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8= -github.com/onflow/cadence v1.0.0-preview.48 h1:WkgU0z6H/oRe44kLL6OO+wkGeKULWChoCT8i7sgiWdg= -github.com/onflow/cadence v1.0.0-preview.48/go.mod h1:BCoenp1TYp+SmG7FGWStjehvvzcvNQ3xvpK5rkthq3Y= +github.com/onflow/cadence v1.0.0-preview.49 h1:MXy6qAtFyRSnqSVKpDkh2J1sb2JEryJoYy/5qsaixlw= +github.com/onflow/cadence v1.0.0-preview.49/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU= github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns= github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY= From 89cddfdd22564049a9a12de2b61292bcf6a98aaf Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Wed, 21 Aug 2024 12:25:47 -0700 Subject: [PATCH 2/2] Update tests --- .../cadence_values_migration_test.go | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/cmd/util/ledger/migrations/cadence_values_migration_test.go b/cmd/util/ledger/migrations/cadence_values_migration_test.go index 97f0bffa2a7..4d30d26eb39 100644 --- a/cmd/util/ledger/migrations/cadence_values_migration_test.go +++ b/cmd/util/ledger/migrations/cadence_values_migration_test.go @@ -2390,7 +2390,7 @@ func TestStoragePathCapabilityMigration(t *testing.T) { interpreter.UnauthorizedAccess, interpreter.PrimitiveStaticTypeString, ), - CapabilityID: 3, + CapabilityID: 4, }, cadenceValueMigrationEntry{ StorageKey: interpreter.StorageKey{ @@ -2407,7 +2407,7 @@ func TestStoragePathCapabilityMigration(t *testing.T) { Path: interpreter.NewUnmeteredPathValue(common.PathDomainStorage, "d"), }, BorrowType: dBorrowType, - CapabilityID: 4, + CapabilityID: 5, }, cadenceValueMigrationEntry{ StorageKey: interpreter.StorageKey{ @@ -2424,7 +2424,7 @@ func TestStoragePathCapabilityMigration(t *testing.T) { Path: interpreter.NewUnmeteredPathValue(common.PathDomainStorage, "a"), }, BorrowType: borrowType, - CapabilityID: 5, + CapabilityID: 3, }, cadenceValueMigrationEntry{ StorageKey: interpreter.StorageKey{ @@ -2451,6 +2451,25 @@ func TestStoragePathCapabilityMigration(t *testing.T) { require.Equal( t, []any{ + storageCapConIssuedEntry{ + AccountAddress: addressB, + AddressPath: interpreter.AddressPath{ + Address: addressB, + Path: interpreter.NewUnmeteredPathValue(common.PathDomainStorage, "a"), + }, + BorrowType: borrowType, + CapabilityID: 3, + }, + storageCapConsMissingBorrowTypeEntry{ + TargetPath: interpreter.AddressPath{ + Address: addressB, + Path: interpreter.NewUnmeteredPathValue(common.PathDomainStorage, "b"), + }, + StoredPath: interpreter.AddressPath{ + Address: addressB, + Path: interpreter.NewUnmeteredPathValue(common.PathDomainStorage, "bCap"), + }, + }, storageCapConsMissingBorrowTypeEntry{ TargetPath: interpreter.AddressPath{ Address: addressB, @@ -2479,7 +2498,7 @@ func TestStoragePathCapabilityMigration(t *testing.T) { Path: interpreter.NewUnmeteredPathValue(common.PathDomainStorage, "c"), }, BorrowType: inferredBorrowType, - CapabilityID: 3, + CapabilityID: 4, }, storageCapConIssuedEntry{ AccountAddress: addressB, @@ -2488,27 +2507,8 @@ func TestStoragePathCapabilityMigration(t *testing.T) { Path: interpreter.NewUnmeteredPathValue(common.PathDomainStorage, "d"), }, BorrowType: dBorrowType, - CapabilityID: 4, - }, - storageCapConIssuedEntry{ - AccountAddress: addressB, - AddressPath: interpreter.AddressPath{ - Address: addressB, - Path: interpreter.NewUnmeteredPathValue(common.PathDomainStorage, "a"), - }, - BorrowType: borrowType, CapabilityID: 5, }, - storageCapConsMissingBorrowTypeEntry{ - TargetPath: interpreter.AddressPath{ - Address: addressB, - Path: interpreter.NewUnmeteredPathValue(common.PathDomainStorage, "b"), - }, - StoredPath: interpreter.AddressPath{ - Address: addressB, - Path: interpreter.NewUnmeteredPathValue(common.PathDomainStorage, "bCap"), - }, - }, }, issueStorageCapConReporter.entries, ) @@ -2527,9 +2527,9 @@ func TestStoragePathCapabilityMigration(t *testing.T) { let aCap = storage.copy(from: /storage/aCap)! let bCap = storage.copy(from: /storage/bCap)! let cCap = storage.copy(from: /storage/cCap)! - assert(aCap.id == 5) + assert(aCap.id == 3) assert(bCap.id == 0) - assert(cCap.id == 3) + assert(cCap.id == 4) } `, addressA.HexWithPrefix(), @@ -2570,7 +2570,7 @@ func TestStoragePathCapabilityMigration(t *testing.T) { let capabilities = getAuthAccount(%s).capabilities.storage let aCapCons = capabilities.getControllers(forPath: /storage/a) assert(aCapCons.length == 1) - assert(aCapCons[0].capabilityID == 5) + assert(aCapCons[0].capabilityID == 3) } `, addressB.HexWithPrefix(),