From 544ee2ef7c3f7aa71dc21585a24a688027241bee Mon Sep 17 00:00:00 2001 From: Tyler Smith Date: Mon, 15 Jul 2024 12:42:14 -0400 Subject: [PATCH] tweak: Add reverted status. --- eth/tracers/blocknative/tracer.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/eth/tracers/blocknative/tracer.go b/eth/tracers/blocknative/tracer.go index e5a7bf11996f..4352f5a17ab8 100644 --- a/eth/tracers/blocknative/tracer.go +++ b/eth/tracers/blocknative/tracer.go @@ -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 @@ -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 {