From 252a3875850fb51097016d94cc39fc0ff77320cd Mon Sep 17 00:00:00 2001 From: Ardit Marku Date: Wed, 27 Sep 2023 11:38:37 +0300 Subject: [PATCH] Remove the emulator.WithRuntime() config --- test/emulator_backend.go | 3 --- test/test_framework_provider.go | 2 -- test/test_framework_test.go | 6 ++---- test/test_runner.go | 1 - 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/test/emulator_backend.go b/test/emulator_backend.go index 3497121d..3d820755 100644 --- a/test/emulator_backend.go +++ b/test/emulator_backend.go @@ -146,7 +146,6 @@ func NewEmulatorBackend( fileResolver FileResolver, stdlibHandler stdlib.StandardLibraryHandler, coverageReport *runtime.CoverageReport, - testRuntime runtime.Runtime, ) *EmulatorBackend { logCollectionHook := newLogCollectionHook() var blockchain *emulator.Blockchain @@ -155,12 +154,10 @@ func NewEmulatorBackend( blockchain = newBlockchain( logCollectionHook, emulator.WithCoverageReport(coverageReport), - emulator.WithRuntime(testRuntime), ) } else { blockchain = newBlockchain( logCollectionHook, - emulator.WithRuntime(testRuntime), ) } clock := newSystemClock() diff --git a/test/test_framework_provider.go b/test/test_framework_provider.go index 33442f70..ee13782f 100644 --- a/test/test_framework_provider.go +++ b/test/test_framework_provider.go @@ -70,7 +70,6 @@ func NewTestFrameworkProvider( fileResolver FileResolver, stdlibHandler stdlib.StandardLibraryHandler, coverageReport *runtime.CoverageReport, - testRuntime runtime.Runtime, ) stdlib.TestFramework { return &TestFrameworkProvider{ fileResolver: fileResolver, @@ -80,7 +79,6 @@ func NewTestFrameworkProvider( fileResolver, stdlibHandler, coverageReport, - testRuntime, ), } } diff --git a/test/test_framework_test.go b/test/test_framework_test.go index 4b19cd8a..ee92294c 100644 --- a/test/test_framework_test.go +++ b/test/test_framework_test.go @@ -3116,8 +3116,7 @@ func TestReplacingImports(t *testing.T) { func TestReplaceImports(t *testing.T) { t.Parallel() - runtime := runtime.NewInterpreterRuntime(runtime.Config{}) - emulatorBackend := NewEmulatorBackend(nil, nil, nil, runtime) + emulatorBackend := NewEmulatorBackend(nil, nil, nil) emulatorBackend.contracts = map[string]common.Address{ "C1": {0, 0, 0, 0, 0, 0, 0, 1}, "C2": {0, 0, 0, 0, 0, 0, 0, 2}, @@ -3270,8 +3269,7 @@ func TestServiceAccount(t *testing.T) { t.Run("retrieve from EmulatorBackend", func(t *testing.T) { t.Parallel() - testRuntime := runtime.NewInterpreterRuntime(runtime.Config{}) - emulatorBackend := NewEmulatorBackend(nil, nil, nil, testRuntime) + emulatorBackend := NewEmulatorBackend(nil, nil, nil) serviceAccount, err := emulatorBackend.ServiceAccount() diff --git a/test/test_runner.go b/test/test_runner.go index 6af6a14d..4caa0602 100644 --- a/test/test_runner.go +++ b/test/test_runner.go @@ -385,7 +385,6 @@ func (r *TestRunner) parseCheckAndInterpret(script string) (*interpreter.Program r.fileResolver, env, r.coverageReport, - r.testRuntime, ) backend, ok := r.testFramework.EmulatorBackend().(*EmulatorBackend) if !ok {