Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
chore: add missing op and idx fields (paradigmxyz#4076)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Aug 5, 2023
1 parent a519641 commit e3457b8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 8 additions & 1 deletion crates/revm/revm-inspectors/src/tracing/builder/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
}

Expand Down
10 changes: 8 additions & 2 deletions crates/rpc/rpc-types/src/eth/trace/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<VmExecutedOperation>,
/// The program counter.
pub pc: usize,
/// Subordinate trace of the CALL/CREATE if applicable.
#[serde(skip_serializing_if = "Option::is_none")]
pub sub: Option<VmTrace>,
/// Stringified opcode.
#[serde(skip_serializing_if = "Option::is_none")]
pub op: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub idx: Option<String>,
}

/// A record of an executed VM operation.
Expand Down

0 comments on commit e3457b8

Please sign in to comment.