chore: add missing op and idx fields (#4076)

This commit is contained in:
Matthias Seitz
2023-08-05 18:59:36 +02:00
committed by GitHub
parent a519641e7d
commit e3457b8866
2 changed files with 16 additions and 3 deletions

View File

@ -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,
}
}
}

View File

@ -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.