Skip to content

Commit

Permalink
tweak: Add reverted status.
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-smith committed Jul 15, 2024
1 parent 1b1a2e9 commit 544ee2e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions eth/tracers/blocknative/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,12 @@ func (t *Tracer) finalizeCallFrame(call *CallFrame, output []byte, gasUsed uint6
// If there was an error or revert then handle it right away and then stop.
if err != nil {
call.Error = err.Error()
if err.Error() == "execution reverted" && len(output) > 0 {
} else if reverted {
call.Error = "execution reverted"
}

if err != nil || reverted {
if len(output) > 0 {
call.Output = output
revertReason, _ := abi.UnpackRevert(output)
call.ErrorReason = revertReason
Expand All @@ -316,10 +321,6 @@ func (t *Tracer) finalizeCallFrame(call *CallFrame, output []byte, gasUsed uint6
return nil
}

if reverted {
return nil
}

// Finalize the decoding.
call.GasUsed = Uint64(gasUsed)
if t.opts.Decode && call.Decoded != nil {
Expand Down

0 comments on commit 544ee2e

Please sign in to comment.