Integrated VM tracing into JSONRPC.
This commit is contained in:
@@ -124,6 +124,7 @@ pub struct InstructionInfo {
|
||||
pub side_effects: bool,
|
||||
pub tier: GasPriceTier
|
||||
}
|
||||
|
||||
impl InstructionInfo {
|
||||
pub fn new(name: &'static str, additional: usize, args: usize, ret: usize, side_effects: bool, tier: GasPriceTier) -> InstructionInfo {
|
||||
InstructionInfo {
|
||||
@@ -139,7 +140,7 @@ impl InstructionInfo {
|
||||
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
/// Return details about specific instruction
|
||||
pub fn get_info (instruction: Instruction) -> InstructionInfo {
|
||||
pub fn get_info(instruction: Instruction) -> InstructionInfo {
|
||||
match instruction {
|
||||
STOP => InstructionInfo::new("STOP", 0, 0, 0, true, GasPriceTier::Zero),
|
||||
ADD => InstructionInfo::new("ADD", 0, 2, 1, false, GasPriceTier::VeryLow),
|
||||
|
||||
@@ -33,3 +33,4 @@ pub use self::evm::{Evm, Error, Result};
|
||||
pub use self::ext::{Ext, ContractCreateResult, MessageCallResult};
|
||||
pub use self::factory::{Factory, VMType};
|
||||
pub use self::schedule::Schedule;
|
||||
pub use self::instructions::get_info;
|
||||
|
||||
@@ -196,7 +196,7 @@ impl<'a> Executive<'a> {
|
||||
};
|
||||
|
||||
// finalize here!
|
||||
Ok(try!(self.finalize(t, substate, gas_left, output, tracer.traces().pop(), vm_tracer.drain())))
|
||||
Ok(try!(self.finalize(t, substate, gas_left, output, tracer.traces().pop(), vm_tracer.drain().and_then(|mut i| i.subs.pop()))))
|
||||
}
|
||||
|
||||
fn exec_vm<T, V>(
|
||||
|
||||
@@ -139,3 +139,4 @@ mod tests;
|
||||
mod json_tests;
|
||||
|
||||
pub use types::*;
|
||||
pub use evm::get_info;
|
||||
|
||||
@@ -106,7 +106,7 @@ impl Tracer for ExecutiveTracer {
|
||||
}
|
||||
}
|
||||
|
||||
/// Simple VM tracer. Traces all operations. Ignores delegatecalls.
|
||||
/// Simple VM tracer. Traces all operations.
|
||||
#[derive(Default)]
|
||||
pub struct ExecutiveVMTracer {
|
||||
data: VMTrace,
|
||||
|
||||
Reference in New Issue
Block a user