From 1dd898c24e85980a3ba9fcc203f00a3ea2f060d6 Mon Sep 17 00:00:00 2001 From: Martin HS Date: Tue, 26 Mar 2024 15:04:15 +0100 Subject: [PATCH] tests: fix panic via state test runner using json logger (#29349) * tests: fix panic via state test runner using json logger * tests: also invoke OnTxEnd --- tests/state_test_util.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/state_test_util.go b/tests/state_test_util.go index 367688e57f..416bab9472 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -295,6 +295,14 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh } evm := vm.NewEVM(context, txContext, st.StateDB, config, vmconfig) + if tracer := vmconfig.Tracer; tracer != nil && tracer.OnTxStart != nil { + tracer.OnTxStart(evm.GetVMContext(), nil, msg.From) + if evm.Config.Tracer.OnTxEnd != nil { + defer func() { + evm.Config.Tracer.OnTxEnd(nil, err) + }() + } + } // Execute the message. snapshot := st.StateDB.Snapshot() gaspool := new(core.GasPool)