From e3457b8866de12c4c1c2cf23c829787d8c7c2fc0 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 5 Aug 2023 18:59:36 +0200 Subject: [PATCH] chore: add missing op and idx fields (#4076) --- .../revm/revm-inspectors/src/tracing/builder/parity.rs | 9 ++++++++- crates/rpc/rpc-types/src/eth/trace/parity.rs | 10 ++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/crates/revm/revm-inspectors/src/tracing/builder/parity.rs b/crates/revm/revm-inspectors/src/tracing/builder/parity.rs index 09eba35209..b70173a8db 100644 --- a/crates/revm/revm-inspectors/src/tracing/builder/parity.rs +++ b/crates/revm/revm-inspectors/src/tracing/builder/parity.rs @@ -365,7 +365,14 @@ impl ParityTraceBuilder { }) .unwrap_or_default(); - VmInstruction { pc: step.pc, cost: cost as u64, ex: maybe_execution, sub: maybe_sub } + VmInstruction { + pc: step.pc, + cost: cost as u64, + ex: maybe_execution, + sub: maybe_sub, + op: Some(step.op.to_string()), + idx: None, + } } } diff --git a/crates/rpc/rpc-types/src/eth/trace/parity.rs b/crates/rpc/rpc-types/src/eth/trace/parity.rs index f99f97de67..60de0b5d15 100644 --- a/crates/rpc/rpc-types/src/eth/trace/parity.rs +++ b/crates/rpc/rpc-types/src/eth/trace/parity.rs @@ -291,14 +291,20 @@ pub struct VmTrace { #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct VmInstruction { - /// The program counter. - pub pc: usize, /// The gas cost for this instruction. pub cost: u64, /// Information concerning the execution of the operation. pub ex: Option, + /// The program counter. + pub pc: usize, /// Subordinate trace of the CALL/CREATE if applicable. + #[serde(skip_serializing_if = "Option::is_none")] pub sub: Option, + /// Stringified opcode. + #[serde(skip_serializing_if = "Option::is_none")] + pub op: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub idx: Option, } /// A record of an executed VM operation.