Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak: Add reverted status. #182

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading