fix: omit output if empty (#4138)

This commit is contained in:
Matthias Seitz
2023-08-10 14:57:39 +02:00
committed by GitHub
parent 628495ae8f
commit a808f7c22d
2 changed files with 3 additions and 1 deletions

View File

@ -438,7 +438,7 @@ impl CallTraceNode {
gas: U256::from(self.trace.gas_limit),
gas_used: U256::from(self.trace.gas_used),
input: self.trace.data.clone().into(),
output: Some(self.trace.output.clone().into()),
output: (!self.trace.output.is_empty()).then(|| self.trace.output.clone().into()),
error: None,
revert_reason: None,
calls: Default::default(),

View File

@ -1,6 +1,8 @@
use reth_primitives::{serde_helper::num::from_int_or_hex, Address, Bytes, H256, U256};
use serde::{Deserialize, Serialize};
/// The response object for `debug_traceTransaction` with `"tracer": "callTracer"`
///
/// <https://github.com/ethereum/go-ethereum/blob/91cb6f863a965481e51d5d9c0e5ccd54796fd967/eth/tracers/native/call.go#L44>
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct CallFrame {