Skip to content

Commit 68abb61

Browse files
holimanmaoueh
authored andcommitted
tests: fix panic via state test runner using json logger (ethereum#29349)
* tests: fix panic via state test runner using json logger * tests: also invoke OnTxEnd
1 parent 3dfb32b commit 68abb61

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/state_test_util.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,14 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
286286
}
287287
evm := vm.NewEVM(context, txContext, statedb, config, vmconfig)
288288

289+
if tracer := vmconfig.Tracer; tracer != nil && tracer.OnTxStart != nil {
290+
tracer.OnTxStart(evm.GetVMContext(), nil, msg.From)
291+
if evm.Config.Tracer.OnTxEnd != nil {
292+
defer func() {
293+
evm.Config.Tracer.OnTxEnd(nil, err)
294+
}()
295+
}
296+
}
289297
// Execute the message.
290298
snapshot := statedb.Snapshot()
291299
gaspool := new(core.GasPool)

0 commit comments

Comments
 (0)