Skip to content

Commit

Permalink
Merge pull request #182 from blocknative/TS_add_revert_status
Browse files Browse the repository at this point in the history
tweak: Add reverted status.
  • Loading branch information
tyler-smith authored Jul 15, 2024
2 parents 1b1a2e9 + 544ee2e commit 52a8b4f
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 52a8b4f

Please sign in to comment.