Skip to content

Commit

Permalink
Fix BenchmarkTransactionTrace
Browse files Browse the repository at this point in the history
  • Loading branch information
s1na committed Oct 24, 2024
1 parent a07cb62 commit cebfd7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eth/tracers/tracers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ func BenchmarkTransactionTrace(b *testing.B) {

for i := 0; i < b.N; i++ {
snap := state.StateDB.Snapshot()
tracer.OnTxStart(evm.GetVMContext(), tx, msg.From)
st := core.NewStateTransition(evm, msg, new(core.GasPool).AddGas(tx.Gas()))
_, err = st.TransitionDb()
res, err := st.TransitionDb()
if err != nil {
b.Fatal(err)
}
tracer.OnTxEnd(&types.Receipt{GasUsed: res.UsedGas}, nil)
state.StateDB.RevertToSnapshot(snap)
if have, want := len(tracer.StructLogs()), 244752; have != want {
b.Fatalf("trace wrong, want %d steps, have %d", want, have)
Expand Down

0 comments on commit cebfd7a

Please sign in to comment.