diff --git a/src/tracing/types.rs b/src/tracing/types.rs index 16b725f3..b1fff1fb 100644 --- a/src/tracing/types.rs +++ b/src/tracing/types.rs @@ -140,6 +140,10 @@ impl CallTrace { InstructionResult::PrecompileError => { if kind.is_parity() { "Built-in failed" } else { "precompiled failed" }.to_string() } + InstructionResult::InvalidFEOpcode => { + if kind.is_parity() { "Bad instruction" } else { "invalid opcode: INVALID" } + .to_string() + } status => format!("{:?}", status), }) } @@ -402,10 +406,19 @@ impl CallTraceNode { // we need to populate error and revert reason if !self.trace.success { + if self.kind().is_any_create() { + call_frame.to = None; + } + + if !self.status().is_revert() { + call_frame.gas_used = U256::from(self.trace.gas_limit); + call_frame.output = None; + } + call_frame.revert_reason = utils::maybe_revert_reason(self.trace.output.as_ref()); - // 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); + // Note: regular calltracer uses geth errors, only flatCallTracer uses parity errors: + call_frame.error = self.trace.as_error_msg(TraceStyle::Geth); } if include_logs && !self.logs.is_empty() {