mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 17:18:08 -05:00
fix(rpc): serialize traces always as vec (#3770)
This commit is contained in:
@@ -138,7 +138,12 @@ impl ParityTraceBuilder {
|
||||
|
||||
let (trace, vm_trace, state_diff) = self.into_trace_type_traces(trace_types);
|
||||
|
||||
TraceResults { output: output.into(), trace, vm_trace, state_diff }
|
||||
TraceResults {
|
||||
output: output.into(),
|
||||
trace: trace.unwrap_or_default(),
|
||||
vm_trace,
|
||||
state_diff,
|
||||
}
|
||||
}
|
||||
|
||||
/// Consumes the inspector and returns the trace results according to the configured trace
|
||||
|
||||
@@ -30,12 +30,13 @@ pub enum TraceType {
|
||||
pub struct TraceResults {
|
||||
/// Output of the trace
|
||||
pub output: Bytes,
|
||||
/// Enabled if [TraceType::Trace] is provided
|
||||
pub trace: Option<Vec<TransactionTrace>>,
|
||||
/// Enabled if [TraceType::VmTrace] is provided
|
||||
pub vm_trace: Option<VmTrace>,
|
||||
/// Enabled if [TraceType::StateDiff] is provided
|
||||
pub state_diff: Option<StateDiff>,
|
||||
/// Enabled if [TraceType::Trace] is provided, otherwise an empty vec
|
||||
#[serde(default)]
|
||||
pub trace: Vec<TransactionTrace>,
|
||||
/// Enabled if [TraceType::VmTrace] is provided
|
||||
pub vm_trace: Option<VmTrace>,
|
||||
}
|
||||
|
||||
/// A `FullTrace` with an additional transaction hash
|
||||
|
||||
Reference in New Issue
Block a user