Skip to content

Commit

Permalink
Merge pull request #6608 from onflow/auto-update-onflow-cadence-v1.2.2
Browse files Browse the repository at this point in the history
Update to Cadence v1.2.2
  • Loading branch information
turbolent authored Oct 31, 2024
2 parents 3496c0f + 3708be5 commit b5fab5c
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linters-settings:
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/onflow/flow-go
local-prefixes: github.com/onflow/flow-go/

gosec:
# To select a subset of rules to run.
Expand Down
4 changes: 1 addition & 3 deletions cmd/util/ledger/migrations/migrator_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ func NewInterpreterMigrationRuntime(
) {
basicMigrationRuntime := NewBasicMigrationRuntime(regs)

env := runtime.NewBaseInterpreterEnvironment(runtime.Config{
AttachmentsEnabled: true,
})
env := runtime.NewBaseInterpreterEnvironment(runtime.Config{})

runtimeInterface, err := config.NewRuntimeInterface(
chainID,
Expand Down
3 changes: 1 addition & 2 deletions engine/execution/computation/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ func DefaultFVMOptions(chainID flow.ChainID, cadenceTracing bool, extensiveTraci
reusableRuntime.NewReusableCadenceRuntimePool(
ReusableCadenceRuntimePoolSize,
runtime.Config{
TracingEnabled: cadenceTracing,
AttachmentsEnabled: true,
TracingEnabled: cadenceTracing,
},
)),
fvm.WithEVMEnabled(true),
Expand Down
28 changes: 28 additions & 0 deletions fvm/environment/mock/environment.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions fvm/evm/stdlib/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
cadenceStdlib "github.com/onflow/cadence/stdlib"
. "github.com/onflow/cadence/tests/runtime_utils"
"github.com/onflow/cadence/tests/utils"
. "github.com/onflow/cadence/test_utils/common_utils"
. "github.com/onflow/cadence/test_utils/runtime_utils"
coreContracts "github.com/onflow/flow-core-contracts/lib/go/contracts"
coreContractstemplates "github.com/onflow/flow-core-contracts/lib/go/templates"
"github.com/onflow/go-ethereum/crypto"
Expand Down Expand Up @@ -2413,7 +2413,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down Expand Up @@ -2498,7 +2498,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down Expand Up @@ -2584,7 +2584,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down Expand Up @@ -2670,7 +2670,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down Expand Up @@ -2766,7 +2766,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down Expand Up @@ -2852,7 +2852,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down Expand Up @@ -2938,7 +2938,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down Expand Up @@ -3024,7 +3024,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down Expand Up @@ -3110,7 +3110,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down Expand Up @@ -3196,7 +3196,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down Expand Up @@ -3292,7 +3292,7 @@ func TestEVMEncodeDecodeABIErrors(t *testing.T) {
Location: nextScriptLocation(),
},
)
utils.RequireError(t, err)
RequireError(t, err)
assert.ErrorContains(
t,
err,
Expand Down
46 changes: 15 additions & 31 deletions fvm/fvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,7 @@ import (
"testing"
"time"

"github.com/rs/zerolog"

"github.com/coreos/go-semver/semver"
"github.com/onflow/flow-core-contracts/lib/go/templates"

"github.com/onflow/flow-go/fvm/storage"
"github.com/onflow/flow-go/fvm/storage/state"

cadenceStdlib "github.com/onflow/cadence/stdlib"

flowsdk "github.com/onflow/flow-go-sdk"
"github.com/onflow/flow-go-sdk/test"

envMock "github.com/onflow/flow-go/fvm/environment/mock"
"github.com/onflow/flow-go/fvm/evm/events"

"github.com/onflow/cadence"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/encoding/ccf"
Expand All @@ -34,8 +19,13 @@ import (
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/tests/utils"
cadenceStdlib "github.com/onflow/cadence/stdlib"
"github.com/onflow/cadence/test_utils/runtime_utils"
"github.com/onflow/crypto"
"github.com/onflow/flow-core-contracts/lib/go/templates"
flowsdk "github.com/onflow/flow-go-sdk"
"github.com/onflow/flow-go-sdk/test"
"github.com/rs/zerolog"
"github.com/stretchr/testify/assert"
mockery "github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
Expand All @@ -45,13 +35,17 @@ import (
"github.com/onflow/flow-go/fvm"
fvmCrypto "github.com/onflow/flow-go/fvm/crypto"
"github.com/onflow/flow-go/fvm/environment"
envMock "github.com/onflow/flow-go/fvm/environment/mock"
"github.com/onflow/flow-go/fvm/errors"
"github.com/onflow/flow-go/fvm/evm/events"
"github.com/onflow/flow-go/fvm/evm/stdlib"
"github.com/onflow/flow-go/fvm/evm/types"
"github.com/onflow/flow-go/fvm/meter"
reusableRuntime "github.com/onflow/flow-go/fvm/runtime"
"github.com/onflow/flow-go/fvm/storage"
"github.com/onflow/flow-go/fvm/storage/snapshot"
"github.com/onflow/flow-go/fvm/storage/snapshot/mock"
"github.com/onflow/flow-go/fvm/storage/state"
"github.com/onflow/flow-go/fvm/storage/testutils"
"github.com/onflow/flow-go/fvm/systemcontracts"
"github.com/onflow/flow-go/fvm/tracing"
Expand Down Expand Up @@ -2416,16 +2410,6 @@ func TestAttachments(t *testing.T) {

newVMTest().
withBootstrapProcedureOptions().
withContextOptions(
fvm.WithReusableCadenceRuntimePool(
reusableRuntime.NewReusableCadenceRuntimePool(
1,
runtime.Config{
AttachmentsEnabled: true,
},
),
),
).
run(
func(
t *testing.T,
Expand Down Expand Up @@ -2622,25 +2606,25 @@ func TestStorageIterationWithBrokenValues(t *testing.T) {
}

// Deploy `A`
runTransaction(utils.DeploymentTransaction(
runTransaction(runtime_utils.DeploymentTransaction(
"A",
[]byte(contractA),
))

// Deploy `B`
runTransaction(utils.DeploymentTransaction(
runTransaction(runtime_utils.DeploymentTransaction(
"B",
[]byte(contractB),
))

// Deploy `C`
runTransaction(utils.DeploymentTransaction(
runTransaction(runtime_utils.DeploymentTransaction(
"C",
[]byte(contractC),
))

// Deploy `D`
runTransaction(utils.DeploymentTransaction(
runTransaction(runtime_utils.DeploymentTransaction(
"D",
[]byte(contractD),
))
Expand Down Expand Up @@ -2682,7 +2666,7 @@ func TestStorageIterationWithBrokenValues(t *testing.T) {
)))

// Update `A`, such that `B`, `C` and `D` are now broken.
runTransaction(utils.UpdateTransaction(
runTransaction(runtime_utils.UpdateTransaction(
"A",
[]byte(updatedContractA),
))
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,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
github.com/onflow/cadence v1.2.1
github.com/onflow/cadence v1.2.2
github.com/onflow/crypto v0.25.2
github.com/onflow/flow v0.3.4
github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0
github.com/onflow/flow-core-contracts/lib/go/templates v1.4.0
github.com/onflow/flow-go-sdk v1.2.2
github.com/onflow/flow-go-sdk v1.2.3
github.com/onflow/flow/protobuf/go/flow v0.4.7
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
github.com/pierrec/lz4 v2.6.1+incompatible
Expand All @@ -77,11 +77,11 @@ require (
go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/atomic v1.11.0
go.uber.org/multierr v1.11.0
golang.org/x/crypto v0.26.0
golang.org/x/crypto v0.28.0
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
golang.org/x/sync v0.8.0
golang.org/x/sys v0.23.0
golang.org/x/text v0.17.0
golang.org/x/sys v0.26.0
golang.org/x/text v0.19.0
golang.org/x/time v0.5.0
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
google.golang.org/api v0.162.0
Expand Down Expand Up @@ -311,7 +311,7 @@ require (
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/term v0.25.0 // indirect
gonum.org/v1/gonum v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,8 @@ github.com/onflow/atree v0.8.0 h1:qg5c6J1gVDNObughpEeWm8oxqhPGdEyGrda121GM4u0=
github.com/onflow/atree v0.8.0/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.2.1 h1:hmSsgX3rTsp2E5qTSl1JXINt8qepdRrHTwDSYqN5Nxs=
github.com/onflow/cadence v1.2.1/go.mod h1:fJxxOAp1wnWDfOHT8GOc1ypsU0RR5E3z51AhG8Yf5jg=
github.com/onflow/cadence v1.2.2 h1:LwigF/2lPiXlwX5rFn71KeMpmW5Iu/f/JtsPLLULBCc=
github.com/onflow/cadence v1.2.2/go.mod h1:PYX1xLejqswtDsQzN93x/VpfSKNyjUk6hrkc/mpv7xs=
github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns=
github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY=
github.com/onflow/flow v0.3.4 h1:FXUWVdYB90f/rjNcY0Owo30gL790tiYff9Pb/sycXYE=
Expand All @@ -927,8 +927,8 @@ github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3
github.com/onflow/flow-ft/lib/go/contracts v1.0.1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A=
github.com/onflow/flow-ft/lib/go/templates v1.0.1 h1:FDYKAiGowABtoMNusLuRCILIZDtVqJ/5tYI4VkF5zfM=
github.com/onflow/flow-ft/lib/go/templates v1.0.1/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE=
github.com/onflow/flow-go-sdk v1.2.2 h1:F78Sq/VaExgtaQv739k06gnx2aIyLF5wVE0XwxFpmsc=
github.com/onflow/flow-go-sdk v1.2.2/go.mod h1:yhQ5+Sp2xWoCQ1fuRDswawTDQ0ng0z5nTkFVH82xL7E=
github.com/onflow/flow-go-sdk v1.2.3 h1:jb+0dIXBO12Zt8x3c2xDXYPv6k3sRTUvhe59M+EcXTI=
github.com/onflow/flow-go-sdk v1.2.3/go.mod h1:jMaffBTlAIdutx+pBhRIigLZFIBYSDDST0Uax1rW2qo=
github.com/onflow/flow-nft/lib/go/contracts v1.2.2 h1:XFERNVUDGbZ4ViZjt7P1cGD80mO1PzUJYPfdhXFsGbQ=
github.com/onflow/flow-nft/lib/go/contracts v1.2.2/go.mod h1:eZ9VMMNfCq0ho6kV25xJn1kXeCfxnkhj3MwF3ed08gY=
github.com/onflow/flow-nft/lib/go/templates v1.2.1 h1:SAALMZPDw9Eb9p5kSLnmnFxjyig1MLiT4JUlLp0/bSE=
Expand Down Expand Up @@ -1319,8 +1319,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -1569,13 +1569,13 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -1586,8 +1586,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
Loading

0 comments on commit b5fab5c

Please sign in to comment.