diff --git a/crates/revm/revm-inspectors/src/tracing/types.rs b/crates/revm/revm-inspectors/src/tracing/types.rs index 7f10a204f3..4f559f43dc 100644 --- a/crates/revm/revm-inspectors/src/tracing/types.rs +++ b/crates/revm/revm-inspectors/src/tracing/types.rs @@ -347,7 +347,10 @@ impl CallTraceNode { // we need to populate error and revert reason if !self.trace.success { - call_frame.revert_reason = decode_revert_reason(self.trace.output.as_ref()); + // decode the revert reason, but don't include it if it's empty + call_frame.revert_reason = decode_revert_reason(self.trace.output.as_ref()) + .filter(|reason| !reason.is_empty()); + // Note: the call tracer mimics parity's trace transaction and geth maps errors to parity style error messages, call_frame.error = self.trace.as_error_msg(TraceStyle::Parity); } @@ -676,3 +679,14 @@ impl AsRef<[u8]> for RecordedMemory { self.as_bytes() } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn decode_empty_revert() { + let reason = decode_revert_reason("".as_bytes()); + assert_eq!(reason, Some("".to_string())); + } +}