diff --git a/engine/common/version/version_control.go b/engine/common/version/version_control.go index 66aea3b635e..d90c7896998 100644 --- a/engine/common/version/version_control.go +++ b/engine/common/version/version_control.go @@ -41,6 +41,7 @@ var defaultCompatibilityOverrides = map[string]struct{}{ "0.37.17": {}, "0.37.18": {}, "0.37.22": {}, + "0.37.26": {}, } // VersionControl manages the version control system for the node. diff --git a/fvm/fvm_test.go b/fvm/fvm_test.go index 44bbb371ca8..63c8eaf6338 100644 --- a/fvm/fvm_test.go +++ b/fvm/fvm_test.go @@ -3355,3 +3355,442 @@ func Test_BlockHashListShouldWriteOnPush(t *testing.T) { require.Equal(t, expectedBlockHashListBucket, newBlockHashListBucket) })) } + +func TestNestedOptionalValueMutation(t *testing.T) { + + t.Parallel() + + setupTest := func( + t *testing.T, + vm fvm.VM, + chain flow.Chain, + ctx fvm.Context, + snapshotTree snapshot.SnapshotTree, + ) (flow.Address, func(code []byte) []string) { + + // Create a private key + privateKeys, err := testutil.GenerateAccountPrivateKeys(1) + require.NoError(t, err) + + // Bootstrap a ledger, creating an account with the provided private key and the root account. + snapshotTree, accounts, err := testutil.CreateAccounts( + vm, + snapshotTree, + privateKeys, + chain, + ) + require.NoError(t, err) + + account := accounts[0] + + var sequenceNumber uint64 = 0 + + runTransaction := func(code []byte) []string { + txBody := flow.NewTransactionBody(). + SetScript(code). + SetPayer(chain.ServiceAddress()). + SetProposalKey(chain.ServiceAddress(), 0, sequenceNumber). + AddAuthorizer(account) + + _ = testutil.SignPayload(txBody, account, privateKeys[0]) + _ = testutil.SignEnvelope(txBody, chain.ServiceAddress(), unittest.ServiceAccountPrivateKey) + + executionSnapshot, output, err := vm.Run( + ctx, + fvm.Transaction(txBody, 0), + snapshotTree, + ) + require.NoError(t, err) + require.NoError(t, output.Err) + + snapshotTree = snapshotTree.Append(executionSnapshot) + + // increment sequence number + sequenceNumber++ + + return output.Logs + } + + return account, runTransaction + } + + buyTicketTransaction := func(account flow.Address) []byte { + return []byte(fmt.Sprintf(` + import Foo from %s + + transaction() { + + prepare(acct: auth(Storage, Capabilities) &Account) { + Foo.logVaultBalance() + var pool = Foo.borrowLotteryPool()! + pool.buyTickets() + Foo.logVaultBalance() + } + + execute {} + }`, + account.HexWithPrefix(), + )) + } + + t.Run("non optional vault", newVMTest(). + withBootstrapProcedureOptions(). + withContextOptions( + fvm.WithReusableCadenceRuntimePool( + reusableRuntime.NewReusableCadenceRuntimePool( + 1, + runtime.Config{}, + ), + ), + fvm.WithContractDeploymentRestricted(false), + fvm.WithCadenceLogging(true), + ). + run( + func( + tt *testing.T, + vm fvm.VM, + chain flow.Chain, + ctx fvm.Context, + snapshotTree snapshot.SnapshotTree, + ) { + account, runTransaction := setupTest(tt, vm, chain, ctx, snapshotTree) + + buyTicketTx := buyTicketTransaction(account) + + contractFoo := ` + access(all) contract Foo { + + access(all) resource Vault { + + access(all) + var balance: UFix64 + + init(balance: UFix64) { + self.balance = balance + } + + access(all) fun withdraw(amount: UFix64): @Vault { + self.balance = self.balance - amount + return <-create Vault(balance: amount) + } + + access(all) fun deposit(from: @Vault) { + self.balance = self.balance + from.balance + destroy from + } + } + + access(all) fun createEmptyVault(): @Vault { + return <- create Vault(balance: 0.0) + } + + access(all) resource LotteryPool { + + access(contract) + let ftVault: @Vault + + init() { + self.ftVault <- Foo.createEmptyVault() + } + + access(all) + fun buyTickets() { + self.borrowVault().deposit(from: <- create Vault(balance: 5.0)) + } + + access(all) fun buyNewTicket() { + self.borrowVault().deposit(from: <- create Vault(balance: 5.0)) + } + + access(self) + view fun borrowVault(): &Vault { + return &self.ftVault as &Vault + } + } + + init() { + self.account.storage.save(<- create LotteryPool(), to: /storage/lottery_pool) + } + + access(all) fun borrowLotteryPool(): &LotteryPool? { + return self.account.storage.borrow<&LotteryPool>(from: /storage/lottery_pool) + } + + access(all) fun logVaultBalance() { + var pool = self.borrowLotteryPool()! + log(pool.ftVault.balance) + } + } + ` + + runTransaction(utils.DeploymentTransaction( + "Foo", + []byte(contractFoo), + )) + + logs := runTransaction(buyTicketTx) + assert.Equal(tt, []string{"0.00000000", "5.00000000"}, logs) + + logs = runTransaction(buyTicketTx) + assert.Equal(tt, []string{"5.00000000", "10.00000000"}, logs) + }, + )) + + t.Run("optional vault", newVMTest(). + withBootstrapProcedureOptions(). + withContextOptions( + fvm.WithReusableCadenceRuntimePool( + reusableRuntime.NewReusableCadenceRuntimePool( + 1, + runtime.Config{}, + ), + ), + fvm.WithContractDeploymentRestricted(false), + fvm.WithCadenceLogging(true), + ). + run( + func( + tt *testing.T, + vm fvm.VM, + chain flow.Chain, + ctx fvm.Context, + snapshotTree snapshot.SnapshotTree, + ) { + account, runTransaction := setupTest(tt, vm, chain, ctx, snapshotTree) + + buyTicketTx := buyTicketTransaction(account) + + contractFoo := ` + access(all) contract Foo { + + access(all) resource Vault { + + access(all) + var balance: UFix64 + + init(balance: UFix64) { + self.balance = balance + } + + access(all) fun withdraw(amount: UFix64): @Vault { + self.balance = self.balance - amount + return <-create Vault(balance: amount) + } + + access(all) fun deposit(from: @Vault) { + self.balance = self.balance + from.balance + destroy from + } + } + + access(all) fun createEmptyVault(): @Vault { + return <- create Vault(balance: 0.0) + } + + access(all) resource LotteryPool { + + access(contract) + let ftVault: @Vault? + + init() { + self.ftVault <- Foo.createEmptyVault() + } + + access(all) + fun buyTickets() { + self.borrowVault().deposit(from: <- create Vault(balance: 5.0)) + } + + access(all) fun buyNewTicket() { + self.borrowVault().deposit(from: <- create Vault(balance: 5.0)) + } + + access(self) + view fun borrowVault(): &Vault { + return &self.ftVault as &Vault? ?? panic("Cannot borrow vault") + } + } + + init() { + self.account.storage.save(<- create LotteryPool(), to: /storage/lottery_pool) + } + + access(all) fun borrowLotteryPool(): &LotteryPool? { + return self.account.storage.borrow<&LotteryPool>(from: /storage/lottery_pool) + } + + access(all) fun logVaultBalance() { + var pool = self.borrowLotteryPool()! + log(pool.ftVault!.balance) + } + } + ` + + runTransaction(utils.DeploymentTransaction( + "Foo", + []byte(contractFoo), + )) + + logs := runTransaction(buyTicketTx) + assert.Equal(tt, []string{"0.00000000", "5.00000000"}, logs) + + logs = runTransaction(buyTicketTx) + assert.Equal(tt, []string{"5.00000000", "10.00000000"}, logs) + }, + )) + + t.Run("deeply nested optional vault", newVMTest(). + withBootstrapProcedureOptions(). + withContextOptions( + fvm.WithReusableCadenceRuntimePool( + reusableRuntime.NewReusableCadenceRuntimePool( + 1, + runtime.Config{}, + ), + ), + fvm.WithContractDeploymentRestricted(false), + fvm.WithCadenceLogging(true), + ). + run( + func( + tt *testing.T, + vm fvm.VM, + chain flow.Chain, + ctx fvm.Context, + snapshotTree snapshot.SnapshotTree, + ) { + account, runTransaction := setupTest(tt, vm, chain, ctx, snapshotTree) + + buyTicketTx := buyTicketTransaction(account) + + contractFoo := ` + access(all) + contract Foo { + + access(all) + resource Vault { + + access(all) + var balance: UFix64 + + init(balance: UFix64) { + self.balance = balance + } + + access(all) + fun withdraw(amount: UFix64): @Vault { + self.balance = self.balance - amount + return <-create Vault(balance: amount) + } + + access(all) + fun deposit(from: @Vault) { + self.balance = self.balance + from.balance + destroy from + } + } + + access(all) + fun createEmptyVault(): @Vault { + return <- create Vault(balance: 0.0) + } + + access(all) + resource LotteryPool { + + access(contract) + let jackpotPool: @Change + + access(contract) + let lotteries: @{UInt64: Lottery} + + init() { + self.jackpotPool <- create Change() + self.lotteries <- {0: <- create Lottery()} + } + + access(all) + fun buyTickets() { + var lotteryRef = self.borrowLotteryRef()! + lotteryRef.buyNewTicket() + } + + access(self) + fun borrowLotteryRef(): &Lottery? { + return &self.lotteries[0] + } + } + + access(all) + resource Lottery { + + access(contract) + let current: @Change + + init() { + self.current <- create Change() + } + + access(all) + fun buyNewTicket() { + var change = self.borrowCurrentLotteryChange() + change.forceMerge() + } + + access(contract) + view fun borrowCurrentLotteryChange(): &Change { + return &self.current + } + } + + access(all) + resource Change { + + access(contract) + var ftVault: @Vault? + + init() { + self.ftVault <- Foo.createEmptyVault() + } + + access(all) + fun forceMerge() { + self.borrowVault().deposit(from: <- create Vault(balance: 5.0)) + } + + access(self) + view fun borrowVault(): &Vault { + return &self.ftVault as &Vault? ?? panic("Cannot borrow vault") + } + } + + init() { + self.account.storage.save(<- create LotteryPool(), to: /storage/lottery_pool) + } + + access(all) + fun borrowLotteryPool(): &LotteryPool? { + return self.account.storage.borrow<&LotteryPool>(from: /storage/lottery_pool) + } + + access(all) + fun logVaultBalance() { + var pool = self.borrowLotteryPool()! + log(pool.lotteries[0]!.current.ftVault!.balance) + } + } + ` + + runTransaction(utils.DeploymentTransaction( + "Foo", + []byte(contractFoo), + )) + + logs := runTransaction(buyTicketTx) + assert.Equal(tt, []string{"0.00000000", "5.00000000"}, logs) + + logs = runTransaction(buyTicketTx) + assert.Equal(tt, []string{"5.00000000", "10.00000000"}, logs) + }, + )) +} diff --git a/go.mod b/go.mod index be0d195a9b3..c2454c8882d 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.6 - github.com/onflow/cadence v1.0.3 + github.com/onflow/atree v0.9.0 + github.com/onflow/cadence v1.0.4 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 @@ -68,7 +68,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.15.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/vmihailenco/msgpack v4.0.4+incompatible github.com/vmihailenco/msgpack/v4 v4.3.11 go.opentelemetry.io/otel v1.24.0 @@ -300,7 +300,7 @@ require ( github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - github.com/zeebo/blake3 v0.2.3 // indirect + github.com/zeebo/blake3 v0.2.4 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect diff --git a/go.sum b/go.sum index 55d2308d6c0..2db0be41828 100644 --- a/go.sum +++ b/go.sum @@ -2164,13 +2164,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.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA= -github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= +github.com/onflow/atree v0.9.0 h1:M+Z/UPwzv0/Yy7ChI5T1ZIHD3YN1cs/hxGEs/HWhzaY= +github.com/onflow/atree v0.9.0/go.mod h1:FT6udJF9Q7VQTu3wknDhFX+VV4D44ZGdqtTAE5iztck= 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.3 h1:g6+V4z3Ntx6ZrwQBTDt0BN3uqeINLbivvamTT8uYs60= -github.com/onflow/cadence v1.0.3/go.mod h1:5vx42Zpapcj7sVRBnC4T0m4tQmi6SN15KKIHeTPxKP8= +github.com/onflow/cadence v1.0.4 h1:lzM0UuzXN0XEJTRQgezK6aaBHkbRpxhsZyO5n8zvZNw= +github.com/onflow/cadence v1.0.4/go.mod h1:SQm8s2O0yLTcwWXhHzIF9GAZJQ3wHZCi5ynwqllQCsA= 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= @@ -2487,8 +2487,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= @@ -2578,8 +2578,9 @@ github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQ github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= -github.com/zeebo/blake3 v0.2.3 h1:TFoLXsjeXqRNFxSbk35Dk4YtszE/MQQGK10BH4ptoTg= github.com/zeebo/blake3 v0.2.3/go.mod h1:mjJjZpnsyIVtVgTOSpJ9vmRE4wgDeyt2HU3qXvvKCaQ= +github.com/zeebo/blake3 v0.2.4 h1:KYQPkhpRtcqh0ssGYcKLG1JYvddkEA8QwCM/yBqhaZI= +github.com/zeebo/blake3 v0.2.4/go.mod h1:7eeQ6d2iXWRGF6npfaxl2CU+xy2Fjo2gxeyZGCRUjcE= github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= diff --git a/insecure/go.mod b/insecure/go.mod index 621959f5583..9ce76567fef 100644 --- a/insecure/go.mod +++ b/insecure/go.mod @@ -14,7 +14,7 @@ require ( github.com/onflow/flow-go v0.36.2-0.20240717162253-d5d2e606ef53 github.com/rs/zerolog v1.29.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/yhassanzadeh13/go-libp2p-pubsub v0.6.11-flow-expose-msg.0.20240220190333-03695dea34a3 // libp2p v0.32.0 go.uber.org/atomic v1.11.0 google.golang.org/grpc v1.63.2 @@ -202,8 +202,8 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onflow/atree v0.8.0-rc.6 // indirect - github.com/onflow/cadence v1.0.3 // indirect + github.com/onflow/atree v0.9.0 // indirect + github.com/onflow/cadence v1.0.4 // 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 @@ -266,7 +266,7 @@ require ( github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - github.com/zeebo/blake3 v0.2.3 // indirect + github.com/zeebo/blake3 v0.2.4 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect diff --git a/insecure/go.sum b/insecure/go.sum index bf4a58dee67..19951d5214c 100644 --- a/insecure/go.sum +++ b/insecure/go.sum @@ -2154,11 +2154,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.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA= -github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= +github.com/onflow/atree v0.9.0 h1:M+Z/UPwzv0/Yy7ChI5T1ZIHD3YN1cs/hxGEs/HWhzaY= +github.com/onflow/atree v0.9.0/go.mod h1:FT6udJF9Q7VQTu3wknDhFX+VV4D44ZGdqtTAE5iztck= github.com/onflow/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8= -github.com/onflow/cadence v1.0.3 h1:g6+V4z3Ntx6ZrwQBTDt0BN3uqeINLbivvamTT8uYs60= -github.com/onflow/cadence v1.0.3/go.mod h1:5vx42Zpapcj7sVRBnC4T0m4tQmi6SN15KKIHeTPxKP8= +github.com/onflow/cadence v1.0.4 h1:lzM0UuzXN0XEJTRQgezK6aaBHkbRpxhsZyO5n8zvZNw= +github.com/onflow/cadence v1.0.4/go.mod h1:SQm8s2O0yLTcwWXhHzIF9GAZJQ3wHZCi5ynwqllQCsA= 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= @@ -2468,8 +2468,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= @@ -2561,8 +2561,9 @@ github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQ github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= -github.com/zeebo/blake3 v0.2.3 h1:TFoLXsjeXqRNFxSbk35Dk4YtszE/MQQGK10BH4ptoTg= github.com/zeebo/blake3 v0.2.3/go.mod h1:mjJjZpnsyIVtVgTOSpJ9vmRE4wgDeyt2HU3qXvvKCaQ= +github.com/zeebo/blake3 v0.2.4 h1:KYQPkhpRtcqh0ssGYcKLG1JYvddkEA8QwCM/yBqhaZI= +github.com/zeebo/blake3 v0.2.4/go.mod h1:7eeQ6d2iXWRGF6npfaxl2CU+xy2Fjo2gxeyZGCRUjcE= github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= diff --git a/integration/go.mod b/integration/go.mod index b0a32e0dec2..312eefeb746 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.3 + github.com/onflow/cadence v1.0.4 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 @@ -34,7 +34,7 @@ require ( github.com/prometheus/client_model v0.5.0 github.com/prometheus/common v0.46.0 github.com/rs/zerolog v1.29.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.einride.tech/pid v0.1.0 go.uber.org/atomic v1.11.0 golang.org/x/exp v0.0.0-20240119083558-1b970713d09a @@ -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.6 // indirect + github.com/onflow/atree v0.9.0 // 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 @@ -312,7 +312,7 @@ require ( github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/yhassanzadeh13/go-libp2p-pubsub v0.6.11-flow-expose-msg.0.20240220190333-03695dea34a3 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - github.com/zeebo/blake3 v0.2.3 // indirect + github.com/zeebo/blake3 v0.2.4 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect diff --git a/integration/go.sum b/integration/go.sum index 9519c711d64..ca10aa2f836 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.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA= -github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= +github.com/onflow/atree v0.9.0 h1:M+Z/UPwzv0/Yy7ChI5T1ZIHD3YN1cs/hxGEs/HWhzaY= +github.com/onflow/atree v0.9.0/go.mod h1:FT6udJF9Q7VQTu3wknDhFX+VV4D44ZGdqtTAE5iztck= github.com/onflow/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8= -github.com/onflow/cadence v1.0.3 h1:g6+V4z3Ntx6ZrwQBTDt0BN3uqeINLbivvamTT8uYs60= -github.com/onflow/cadence v1.0.3/go.mod h1:5vx42Zpapcj7sVRBnC4T0m4tQmi6SN15KKIHeTPxKP8= +github.com/onflow/cadence v1.0.4 h1:lzM0UuzXN0XEJTRQgezK6aaBHkbRpxhsZyO5n8zvZNw= +github.com/onflow/cadence v1.0.4/go.mod h1:SQm8s2O0yLTcwWXhHzIF9GAZJQ3wHZCi5ynwqllQCsA= 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= @@ -2444,8 +2444,9 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= @@ -2533,8 +2534,9 @@ github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQ github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= -github.com/zeebo/blake3 v0.2.3 h1:TFoLXsjeXqRNFxSbk35Dk4YtszE/MQQGK10BH4ptoTg= github.com/zeebo/blake3 v0.2.3/go.mod h1:mjJjZpnsyIVtVgTOSpJ9vmRE4wgDeyt2HU3qXvvKCaQ= +github.com/zeebo/blake3 v0.2.4 h1:KYQPkhpRtcqh0ssGYcKLG1JYvddkEA8QwCM/yBqhaZI= +github.com/zeebo/blake3 v0.2.4/go.mod h1:7eeQ6d2iXWRGF6npfaxl2CU+xy2Fjo2gxeyZGCRUjcE= github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= diff --git a/model/flow/protocol_state_test.go b/model/flow/protocol_state_test.go index f0245761ad7..3fdb3122231 100644 --- a/model/flow/protocol_state_test.go +++ b/model/flow/protocol_state_test.go @@ -331,7 +331,6 @@ func TestProtocolStateEntry_Copy(t *testing.T) { assert.Equal(t, entry, cpy) assert.NotSame(t, entry.NextEpoch, cpy.NextEpoch) assert.NotSame(t, entry.PreviousEpoch, cpy.PreviousEpoch) - assert.NotSame(t, entry.CurrentEpoch, cpy.CurrentEpoch) cpy.EpochFallbackTriggered = !entry.EpochFallbackTriggered assert.NotEqual(t, entry, cpy)