Skip to content

Commit

Permalink
Merge pull request onflow#6627 from m-Peter/mpeter/fix-evm-trace-zero…
Browse files Browse the repository at this point in the history
…-gas-field

[Flow EVM] Move tracing reset to `OnTxEnd` hook
  • Loading branch information
janezpodhostnik authored Nov 14, 2024
2 parents a764d3e + 269053f commit 22daf5c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fvm/evm/debug/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@ func NewSafeTxTracer(ct *CallTracer) *tracers.Tracer {
if ct.tracer.OnTxStart != nil {
ct.tracer.OnTxStart(vm, tx, from)
}
// reset tracing to have fresh state
if err := ct.ResetTracer(); err != nil {
l.Error().Err(err).
Msg("failed to reset tracer")
return
}
}

wrapped.OnTxEnd = func(receipt *types.Receipt, err error) {
Expand All @@ -197,6 +191,13 @@ func NewSafeTxTracer(ct *CallTracer) *tracers.Tracer {
return
}
ct.resultsByTxID[receipt.TxHash] = res

// reset tracing to have fresh state
if err := ct.ResetTracer(); err != nil {
l.Error().Err(err).
Msg("failed to reset tracer")
return
}
}

wrapped.OnEnter = func(
Expand Down

0 comments on commit 22daf5c

Please sign in to comment.