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
This commit is contained in:
Martin HS 2024-03-26 15:04:15 +01:00 committed by GitHub
parent f2a6ac17b2
commit 1dd898c24e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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)