Fixing warnings

This commit is contained in:
Tomasz Drwięga
2016-06-03 11:36:30 +02:00
parent ae2deaaf72
commit 3905717d5d
11 changed files with 53 additions and 55 deletions

View File

@@ -117,7 +117,7 @@ impl VMTracer for ExecutiveVMTracer {
self.data.operations.push(VMOperation {
pc: pc,
instruction: instruction,
gas_cost: gas_cost.clone(),
gas_cost: gas_cost.clone(),
executed: None,
});
true
@@ -133,10 +133,10 @@ impl VMTracer for ExecutiveVMTracer {
self.data.operations.last_mut().expect("trace_executed is always called after a trace_prepare_execute").executed = Some(ex);
}
fn prepare_subtrace(&self, code: &Bytes) -> Self {
fn prepare_subtrace(&self, code: &[u8]) -> Self {
ExecutiveVMTracer { data: VMTrace {
parent_step: self.data.operations.len(),
code: code.clone(),
code: code.to_vec(),
operations: vec![],
subs: vec![],
}}

View File

@@ -98,7 +98,7 @@ pub trait VMTracer: Send {
fn trace_executed(&mut self, _gas_used: U256, _stack_push: &[U256], _mem_diff: Option<(usize, &[u8])>, _store_diff: Option<(U256, U256)>) {}
/// Spawn subtracer which will be used to trace deeper levels of execution.
fn prepare_subtrace(&self, code: &Bytes) -> Self where Self: Sized;
fn prepare_subtrace(&self, code: &[u8]) -> Self where Self: Sized;
/// Spawn subtracer which will be used to trace deeper levels of execution.
fn done_subtrace(&mut self, sub: Self) where Self: Sized;

View File

@@ -75,7 +75,7 @@ impl VMTracer for NoopVMTracer {
fn trace_executed(&mut self, _gas_used: U256, _stack_push: &[U256], _mem_diff: Option<(usize, &[u8])>, _store_diff: Option<(U256, U256)>) {}
/// Spawn subtracer which will be used to trace deeper levels of execution.
fn prepare_subtrace(&self, _code: &Bytes) -> Self { NoopVMTracer }
fn prepare_subtrace(&self, _code: &[u8]) -> Self { NoopVMTracer }
/// Spawn subtracer which will be used to trace deeper levels of execution.
fn done_subtrace(&mut self, _sub: Self) {}