From e2d1b51753cc1e01e05ee529cfaf11f03f2cffea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Thu, 18 Apr 2024 15:32:40 -0700 Subject: [PATCH] fix EVM load test: provide blocks and block header --- integration/benchmark/load/load_type_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/integration/benchmark/load/load_type_test.go b/integration/benchmark/load/load_type_test.go index 1517924a7e5..fee4c2b118f 100644 --- a/integration/benchmark/load/load_type_test.go +++ b/integration/benchmark/load/load_type_test.go @@ -19,6 +19,7 @@ import ( "github.com/onflow/flow-go/engine/execution/testutil" "github.com/onflow/flow-go/fvm" "github.com/onflow/flow-go/fvm/environment" + envMock "github.com/onflow/flow-go/fvm/environment/mock" "github.com/onflow/flow-go/fvm/storage/snapshot" "github.com/onflow/flow-go/integration/benchmark/account" "github.com/onflow/flow-go/integration/benchmark/common" @@ -119,12 +120,21 @@ func testLoad(log zerolog.Logger, l load.Load) func(t *testing.T) { func bootstrapVM(t *testing.T, chain flow.Chain) (*fvm.VirtualMachine, fvm.Context, snapshot.SnapshotTree) { source := testutil.EntropyProviderFixture(nil) + blocks := new(envMock.Blocks) + block1 := unittest.BlockFixture() + blocks.On("ByHeightFrom", + block1.Header.Height, + block1.Header, + ).Return(block1.Header, nil) + opts := computation.DefaultFVMOptions(chain.ChainID(), false, false) opts = append(opts, fvm.WithTransactionFeesEnabled(true), fvm.WithAccountStorageLimit(true), fvm.WithContractDeploymentRestricted(false), fvm.WithEntropyProvider(source), + fvm.WithBlocks(blocks), + fvm.WithBlockHeader(block1.Header), ) ctx := fvm.NewContext(opts...)