Trait ethcore::trace::VMTracer
[−]
[src]
pub trait VMTracer: Send { type Output; fn prepare_subtrace(&self, code: &[u8]) -> Self
where
Self: Sized; fn done_subtrace(&mut self, sub: Self)
where
Self: Sized; fn drain(self) -> Option<Self::Output>; fn trace_next_instruction(
&mut self,
_pc: usize,
_instruction: u8,
_current_gas: U256
) -> bool { ... } fn trace_prepare_execute(
&mut self,
_pc: usize,
_instruction: u8,
_gas_cost: U256
) { ... } fn trace_executed(
&mut self,
_gas_used: U256,
_stack_push: &[U256],
_mem_diff: Option<(usize, &[u8])>,
_store_diff: Option<(U256, U256)>
) { ... } }
Used by executive to build VM traces.
Associated Types
type Output
Data returned when draining the VMTracer.
Required Methods
fn prepare_subtrace(&self, code: &[u8]) -> Self where
Self: Sized,
Self: Sized,
Spawn subtracer which will be used to trace deeper levels of execution.
fn done_subtrace(&mut self, sub: Self) where
Self: Sized,
Self: Sized,
Finalize subtracer.
fn drain(self) -> Option<Self::Output>
Consumes self and returns the VM trace.
Provided Methods
fn trace_next_instruction(
&mut self,
_pc: usize,
_instruction: u8,
_current_gas: U256
) -> bool
&mut self,
_pc: usize,
_instruction: u8,
_current_gas: U256
) -> bool
Trace the progression of interpreter to next instruction.
If tracer returns false
it won't be called again.
@returns true if trace_prepare_execute
and trace_executed
should be called.
fn trace_prepare_execute(
&mut self,
_pc: usize,
_instruction: u8,
_gas_cost: U256
)
&mut self,
_pc: usize,
_instruction: u8,
_gas_cost: U256
)
Trace the preparation to execute a single valid instruction.
fn trace_executed(
&mut self,
_gas_used: U256,
_stack_push: &[U256],
_mem_diff: Option<(usize, &[u8])>,
_store_diff: Option<(U256, U256)>
)
&mut self,
_gas_used: U256,
_stack_push: &[U256],
_mem_diff: Option<(usize, &[u8])>,
_store_diff: Option<(U256, U256)>
)
Trace the finalised execution of a single valid instruction.
Implementors
impl VMTracer for ExecutiveVMTracer type Output = VMTrace;
impl VMTracer for NoopVMTracer type Output = VMTrace;