From e0f8a9b1ce76ee8b403e03403c8eaab36494916e Mon Sep 17 00:00:00 2001 From: Ardit Marku Date: Tue, 16 Apr 2024 09:47:28 +0300 Subject: [PATCH] Re-use environment from runtime.Context argument --- test/test_runner.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_runner.go b/test/test_runner.go index 5e84bde7..a3a0e977 100644 --- a/test/test_runner.go +++ b/test/test_runner.go @@ -795,7 +795,11 @@ func (r *TestRunner) parseAndCheckImport( env.CheckerConfig.ContractValueHandler = contractValueHandler - err = setupEVMEnvironment(r.backend.blockchain.NewScriptEnvironment(), env) + fvmEnv, ok := startCtx.Interface.(environment.Environment) + if !ok { + panic(fmt.Errorf("failed to retrieve FVM Environment")) + } + err = setupEVMEnvironment(fvmEnv, env) if err != nil { panic(err) }