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

Commit

Permalink
Fix review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Oct 2, 2018
1 parent 262899a commit ffc2dc9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ethcore/evm/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub trait Finalize {

impl Finalize for Result<GasLeft> {
fn finalize<E: Ext>(self, mut ext: E) -> Result<FinalizationResult> {
ext.trace_done();
ext.trace_finalized();

match self {
Ok(GasLeft::Known(gas_left)) => Ok(FinalizationResult { gas_left: gas_left, apply_state: true, return_data: ReturnData::empty() }),
Expand Down
4 changes: 2 additions & 2 deletions ethcore/src/externalities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,11 @@ impl<'a, T: 'a, V: 'a, B: 'a> Ext for Externalities<'a, T, V, B>
vm_tracer.trace_executed(gas_used, stack_push, mem_diff, store_diff, &access);
}

fn trace_done(&mut self) {
fn trace_finalized(&mut self) {
let Externalities { ref state, ref mut vm_tracer, .. } = *self;

let access = ExtStorageAccess(*state, &self.origin_info.address);
vm_tracer.trace_done(&access);
vm_tracer.trace_finalized(&access);
}
}

Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub trait VMTracer: Send {
/// Trace the end of a subtrace.
///
/// After this, no more instructions will be executed for this subtrace.
fn trace_done(&mut self, _storage_access: &StorageAccess) {}
fn trace_finalized(&mut self, _storage_access: &StorageAccess) {}

/// Spawn subtracer which will be used to trace deeper levels of execution.
fn prepare_subtrace(&self, code: &[u8]) -> Self where Self: Sized;
Expand Down
4 changes: 2 additions & 2 deletions ethcore/vm/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ pub trait Ext {
/// Trace the finalised execution of a single instruction.
fn trace_executed(&mut self, _gas_used: U256, _stack_push: &[U256], _mem_diff: Option<(usize, &[u8])>, _store_diff: Option<(U256, U256)>) {}

/// Trace that the subtrace has done executing.
fn trace_done(&mut self) {}
/// Trace that the subtrace is done executing.
fn trace_finalized(&mut self) {}

/// Check if running in static context.
fn is_static(&self) -> bool;
Expand Down
4 changes: 2 additions & 2 deletions evmbin/src/display/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl trace::VMTracer for Informant {
self.gas_cost = gas_cost;
}

fn trace_executed(&mut self, gas_used: U256, stack_push: &[U256], mem_diff: Option<(usize, &[u8])>, store_diff: Option<(U256, U256)>, storage: &storage::StorageAccess) {
fn trace_executed(&mut self, gas_used: U256, stack_push: &[U256], mem_diff: Option<(usize, &[u8])>, store_diff: Option<(U256, U256)>, _storage: &storage::StorageAccess) {
let info = ::evm::Instruction::from_u8(self.instruction).map(|i| i.info());

let trace = json!({
Expand Down Expand Up @@ -142,7 +142,7 @@ impl trace::VMTracer for Informant {
}
}

fn trace_done(&mut self, storage: &storage::StorageAccess) {
fn trace_finalized(&mut self, storage: &storage::StorageAccess) {
if self.unmatched {
// print last line with final state:
self.gas_cost = 0.into();
Expand Down
2 changes: 1 addition & 1 deletion evmbin/src/display/std_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl<Trace: Writer, Out: Writer> trace::VMTracer for Informant<Trace, Out> {
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)>, storage: &storage::StorageAccess) {
fn trace_executed(&mut self, _gas_used: U256, stack_push: &[U256], _mem_diff: Option<(usize, &[u8])>, store_diff: Option<(U256, U256)>, _storage: &storage::StorageAccess) {
let info = ::evm::Instruction::from_u8(self.instruction).map(|i| i.info());

let len = self.stack.len();
Expand Down

0 comments on commit ffc2dc9

Please sign in to comment.