Skip to content

Commit

Permalink
Merge pull request #6288 from onflow/auto-update-onflow-cadence-v1.0.…
Browse files Browse the repository at this point in the history
…0-preview.42

Update to Cadence v1.0.0-preview.42
  • Loading branch information
turbolent authored Jul 31, 2024
2 parents 5884847 + fe3da4c commit 60e14fd
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 27 deletions.
5 changes: 5 additions & 0 deletions cmd/util/ledger/migrations/cadence_values_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,11 +503,13 @@ func (t *cadenceValueMigrationReporter) MigratedPathCapability(
accountAddress common.Address,
addressPath interpreter.AddressPath,
borrowType *interpreter.ReferenceStaticType,
capabilityID interpreter.UInt64Value,
) {
t.reportWriter.Write(capabilityMigrationEntry{
AccountAddress: accountAddress,
AddressPath: addressPath,
BorrowType: borrowType,
CapabilityID: capabilityID,
})
}

Expand Down Expand Up @@ -656,6 +658,7 @@ type capabilityMigrationEntry struct {
AccountAddress common.Address
AddressPath interpreter.AddressPath
BorrowType *interpreter.ReferenceStaticType
CapabilityID interpreter.UInt64Value
}

var _ valueMigrationReportEntry = capabilityMigrationEntry{}
Expand All @@ -673,12 +676,14 @@ func (e capabilityMigrationEntry) MarshalJSON() ([]byte, error) {
Address string `json:"address"`
Path string `json:"path"`
BorrowType string `json:"borrow_type"`
CapabilityID string `json:"capability_id"`
}{
Kind: "capability-migration-success",
AccountAddress: e.AccountAddress.HexWithPrefix(),
Address: e.AddressPath.Address.HexWithPrefix(),
Path: e.AddressPath.Path.String(),
BorrowType: string(e.BorrowType.ID()),
CapabilityID: e.CapabilityID.String(),
})
}

Expand Down
36 changes: 27 additions & 9 deletions cmd/util/ledger/migrations/cadence_values_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,13 +836,17 @@ func checkReporters(
AccountAddress: address,
AddressPath: interpreter.AddressPath{
Address: address,
Path: interpreter.PathValue{Identifier: "linkR", Domain: 0x3},
Path: interpreter.PathValue{
Identifier: "linkR",
Domain: common.PathDomainPublic,
},
},
BorrowType: interpreter.NewReferenceStaticType(
nil,
entitlementAuthorization(),
rResourceType,
),
CapabilityID: 2,
},
cadenceValueMigrationEntry{
StorageKey: interpreter.StorageKey{Key: "storage", Address: address},
Expand All @@ -852,13 +856,17 @@ func checkReporters(
capabilityMigrationEntry{
AccountAddress: address,
AddressPath: interpreter.AddressPath{
Address: address, Path: interpreter.PathValue{Identifier: "linkR", Domain: 0x3},
Address: address, Path: interpreter.PathValue{
Identifier: "linkR",
Domain: common.PathDomainPublic,
},
},
BorrowType: interpreter.NewReferenceStaticType(
nil,
entitlementAuthorization(),
rResourceType,
),
CapabilityID: 2,
},
cadenceValueMigrationEntry{
StorageKey: interpreter.StorageKey{Key: "storage", Address: address},
Expand All @@ -868,9 +876,12 @@ func checkReporters(
linkMigrationEntry{
AccountAddressPath: interpreter.AddressPath{
Address: address,
Path: interpreter.PathValue{Identifier: "flowTokenReceiver", Domain: 0x3},
Path: interpreter.PathValue{
Identifier: "flowTokenReceiver",
Domain: common.PathDomainPublic,
},
},
CapabilityID: 0x1,
CapabilityID: 1,
},
cadenceValueMigrationEntry{
StorageKey: interpreter.StorageKey{Key: "public", Address: address},
Expand All @@ -880,9 +891,12 @@ func checkReporters(
linkMigrationEntry{
AccountAddressPath: interpreter.AddressPath{
Address: address,
Path: interpreter.PathValue{Identifier: "linkR", Domain: 0x3},
Path: interpreter.PathValue{
Identifier: "linkR",
Domain: common.PathDomainPublic,
},
},
CapabilityID: 0x2,
CapabilityID: 2,
},
cadenceValueMigrationEntry{
StorageKey: interpreter.StorageKey{Key: "public", Address: address},
Expand All @@ -892,9 +906,12 @@ func checkReporters(
linkMigrationEntry{
AccountAddressPath: interpreter.AddressPath{
Address: address,
Path: interpreter.PathValue{Identifier: "flowTokenBalance", Domain: 0x3},
Path: interpreter.PathValue{
Identifier: "flowTokenBalance",
Domain: common.PathDomainPublic,
},
},
CapabilityID: 0x3,
CapabilityID: 3,
},
cadenceValueMigrationEntry{
StorageKey: interpreter.StorageKey{Key: "public", Address: address},
Expand Down Expand Up @@ -2020,7 +2037,8 @@ func TestCapabilityMigrationEntry_MarshalJSON(t *testing.T) {
"account_address": "0x0000000000000002",
"address": "0x0000000000000001",
"path": "/public/test",
"borrow_type": "&Int"
"borrow_type": "&Int",
"capability_id": "0"
}`,
string(actual),
)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ require (
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.41
github.com/onflow/cadence v1.0.0-preview.42
github.com/onflow/crypto v0.25.1
github.com/onflow/flow v0.3.4
github.com/onflow/flow-core-contracts/lib/go/contracts v1.3.1
github.com/onflow/flow-core-contracts/lib/go/templates v1.3.1
github.com/onflow/flow-go-sdk v1.0.0-preview.44
github.com/onflow/flow-go-sdk v1.0.0-preview.45
github.com/onflow/flow/protobuf/go/flow v0.4.5
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
github.com/pierrec/lz4 v2.6.1+incompatible
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2167,8 +2167,8 @@ github.com/onflow/atree v0.8.0-rc.5/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/
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.41 h1:nEfnCF8IA/+i31twFKOimzbDVUo4tOlaqBtlDaGB4qM=
github.com/onflow/cadence v1.0.0-preview.41/go.mod h1:BCoenp1TYp+SmG7FGWStjehvvzcvNQ3xvpK5rkthq3Y=
github.com/onflow/cadence v1.0.0-preview.42 h1:oJYGxKn/oMiJnhwbuviSQRJFAFiNKcEt6YBqNX61Bu4=
github.com/onflow/cadence v1.0.0-preview.42/go.mod h1:BCoenp1TYp+SmG7FGWStjehvvzcvNQ3xvpK5rkthq3Y=
github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A=
github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
Expand All @@ -2183,8 +2183,8 @@ github.com/onflow/flow-ft/lib/go/contracts v1.0.0/go.mod h1:PwsL8fC81cjnUnTfmyL/
github.com/onflow/flow-ft/lib/go/templates v1.0.0 h1:6cMS/lUJJ17HjKBfMO/eh0GGvnpElPgBXx7h5aoWJhs=
github.com/onflow/flow-ft/lib/go/templates v1.0.0/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE=
github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo=
github.com/onflow/flow-go-sdk v1.0.0-preview.44 h1:KgO5OedGS94UPDRpnvPH4bEfNKt4VI8BP16rY+LCuQE=
github.com/onflow/flow-go-sdk v1.0.0-preview.44/go.mod h1:TWKQyGN2rrTlMem1g8ATOHOKJfjjzLUwjJsoe7vLfxY=
github.com/onflow/flow-go-sdk v1.0.0-preview.45 h1:cbxKT2Z1umA4Vib0t28xHiFrygZyyjBqIcYGaeE9dzg=
github.com/onflow/flow-go-sdk v1.0.0-preview.45/go.mod h1:26E0SDbNHkxtBnxOatQi3tpAh8tehsV8gt/8IH2nyww=
github.com/onflow/flow-nft/lib/go/contracts v1.2.1 h1:woAAS5z651sDpi7ihAHll8NvRS9uFXIXkL6xR+bKFZY=
github.com/onflow/flow-nft/lib/go/contracts v1.2.1/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE=
github.com/onflow/flow-nft/lib/go/templates v1.2.0 h1:JSQyh9rg0RC+D1930BiRXN8lrtMs+ubVMK6aQPon6Yc=
Expand Down
4 changes: 2 additions & 2 deletions insecure/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ require (
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.41 // indirect
github.com/onflow/cadence v1.0.0-preview.42 // 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
github.com/onflow/flow-ft/lib/go/templates v1.0.0 // indirect
github.com/onflow/flow-go-sdk v1.0.0-preview.44 // indirect
github.com/onflow/flow-go-sdk v1.0.0-preview.45 // indirect
github.com/onflow/flow-nft/lib/go/contracts v1.2.1 // indirect
github.com/onflow/flow-nft/lib/go/templates v1.2.0 // indirect
github.com/onflow/flow/protobuf/go/flow v0.4.5 // indirect
Expand Down
8 changes: 4 additions & 4 deletions insecure/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2157,8 +2157,8 @@ github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs
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/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8=
github.com/onflow/cadence v1.0.0-preview.41 h1:nEfnCF8IA/+i31twFKOimzbDVUo4tOlaqBtlDaGB4qM=
github.com/onflow/cadence v1.0.0-preview.41/go.mod h1:BCoenp1TYp+SmG7FGWStjehvvzcvNQ3xvpK5rkthq3Y=
github.com/onflow/cadence v1.0.0-preview.42 h1:oJYGxKn/oMiJnhwbuviSQRJFAFiNKcEt6YBqNX61Bu4=
github.com/onflow/cadence v1.0.0-preview.42/go.mod h1:BCoenp1TYp+SmG7FGWStjehvvzcvNQ3xvpK5rkthq3Y=
github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A=
github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
Expand All @@ -2171,8 +2171,8 @@ github.com/onflow/flow-ft/lib/go/contracts v1.0.0/go.mod h1:PwsL8fC81cjnUnTfmyL/
github.com/onflow/flow-ft/lib/go/templates v1.0.0 h1:6cMS/lUJJ17HjKBfMO/eh0GGvnpElPgBXx7h5aoWJhs=
github.com/onflow/flow-ft/lib/go/templates v1.0.0/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE=
github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo=
github.com/onflow/flow-go-sdk v1.0.0-preview.44 h1:KgO5OedGS94UPDRpnvPH4bEfNKt4VI8BP16rY+LCuQE=
github.com/onflow/flow-go-sdk v1.0.0-preview.44/go.mod h1:TWKQyGN2rrTlMem1g8ATOHOKJfjjzLUwjJsoe7vLfxY=
github.com/onflow/flow-go-sdk v1.0.0-preview.45 h1:cbxKT2Z1umA4Vib0t28xHiFrygZyyjBqIcYGaeE9dzg=
github.com/onflow/flow-go-sdk v1.0.0-preview.45/go.mod h1:26E0SDbNHkxtBnxOatQi3tpAh8tehsV8gt/8IH2nyww=
github.com/onflow/flow-nft/lib/go/contracts v1.2.1 h1:woAAS5z651sDpi7ihAHll8NvRS9uFXIXkL6xR+bKFZY=
github.com/onflow/flow-nft/lib/go/contracts v1.2.1/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE=
github.com/onflow/flow-nft/lib/go/templates v1.2.0 h1:JSQyh9rg0RC+D1930BiRXN8lrtMs+ubVMK6aQPon6Yc=
Expand Down
4 changes: 2 additions & 2 deletions integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ require (
github.com/ipfs/go-datastore v0.6.0
github.com/ipfs/go-ds-badger2 v0.1.3
github.com/libp2p/go-libp2p v0.32.2
github.com/onflow/cadence v1.0.0-preview.41
github.com/onflow/cadence v1.0.0-preview.42
github.com/onflow/crypto v0.25.1
github.com/onflow/flow-core-contracts/lib/go/contracts v1.3.1
github.com/onflow/flow-core-contracts/lib/go/templates v1.3.1
github.com/onflow/flow-emulator v1.0.0-preview.36.0.20240729195722-d4eb1c30eb9f
github.com/onflow/flow-go v0.36.8-0.20240729193633-433a32eeb0cd
github.com/onflow/flow-go-sdk v1.0.0-preview.44
github.com/onflow/flow-go-sdk v1.0.0-preview.45
github.com/onflow/flow-go/insecure v0.0.0-00010101000000-000000000000
github.com/onflow/flow/protobuf/go/flow v0.4.5
github.com/onflow/go-ethereum v1.14.7
Expand Down
8 changes: 4 additions & 4 deletions integration/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2141,8 +2141,8 @@ github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs
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/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8=
github.com/onflow/cadence v1.0.0-preview.41 h1:nEfnCF8IA/+i31twFKOimzbDVUo4tOlaqBtlDaGB4qM=
github.com/onflow/cadence v1.0.0-preview.41/go.mod h1:BCoenp1TYp+SmG7FGWStjehvvzcvNQ3xvpK5rkthq3Y=
github.com/onflow/cadence v1.0.0-preview.42 h1:oJYGxKn/oMiJnhwbuviSQRJFAFiNKcEt6YBqNX61Bu4=
github.com/onflow/cadence v1.0.0-preview.42/go.mod h1:BCoenp1TYp+SmG7FGWStjehvvzcvNQ3xvpK5rkthq3Y=
github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A=
github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
Expand All @@ -2157,8 +2157,8 @@ github.com/onflow/flow-ft/lib/go/contracts v1.0.0/go.mod h1:PwsL8fC81cjnUnTfmyL/
github.com/onflow/flow-ft/lib/go/templates v1.0.0 h1:6cMS/lUJJ17HjKBfMO/eh0GGvnpElPgBXx7h5aoWJhs=
github.com/onflow/flow-ft/lib/go/templates v1.0.0/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE=
github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo=
github.com/onflow/flow-go-sdk v1.0.0-preview.44 h1:KgO5OedGS94UPDRpnvPH4bEfNKt4VI8BP16rY+LCuQE=
github.com/onflow/flow-go-sdk v1.0.0-preview.44/go.mod h1:TWKQyGN2rrTlMem1g8ATOHOKJfjjzLUwjJsoe7vLfxY=
github.com/onflow/flow-go-sdk v1.0.0-preview.45 h1:cbxKT2Z1umA4Vib0t28xHiFrygZyyjBqIcYGaeE9dzg=
github.com/onflow/flow-go-sdk v1.0.0-preview.45/go.mod h1:26E0SDbNHkxtBnxOatQi3tpAh8tehsV8gt/8IH2nyww=
github.com/onflow/flow-nft/lib/go/contracts v1.2.1 h1:woAAS5z651sDpi7ihAHll8NvRS9uFXIXkL6xR+bKFZY=
github.com/onflow/flow-nft/lib/go/contracts v1.2.1/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE=
github.com/onflow/flow-nft/lib/go/templates v1.2.0 h1:JSQyh9rg0RC+D1930BiRXN8lrtMs+ubVMK6aQPon6Yc=
Expand Down

0 comments on commit 60e14fd

Please sign in to comment.