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

Commit

Permalink
fixed merge
Browse files Browse the repository at this point in the history
  • Loading branch information
debris committed Aug 30, 2017
1 parent 88200a1 commit 8a420d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 29 deletions.
6 changes: 3 additions & 3 deletions ethcore/src/engines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ pub mod common {

/// Trace rewards on closing block
pub fn bestow_block_reward<E: Engine + ?Sized>(block: &mut ExecutedBlock, engine: &E) -> Result<(), Error> {
let fields = block.fields_mut();
let fields = block.fields_mut();
// Bestow block reward
let reward = engine.params().block_reward;
let res = fields.state.add_balance(fields.header.author(), &reward, CleanupMode::NoEmpty)
Expand All @@ -482,9 +482,9 @@ pub mod common {

let block_author = fields.header.author().clone();
fields.traces.as_mut().map(|mut traces| {
let mut tracer = ExecutiveTracer::default();
let mut tracer = ExecutiveTracer::default();
tracer.trace_reward(block_author, engine.params().block_reward, RewardType::Block);
traces.push(tracer.traces())
traces.push(tracer.drain())
});

// Commit state so that we can actually figure out the state root.
Expand Down
6 changes: 3 additions & 3 deletions ethcore/src/engines/null_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl Engine for NullEngine {

/// Block reward
let tracing_enabled = block.tracing_enabled();
let fields = block.fields_mut();
let fields = block.fields_mut();
let mut tracer = ExecutiveTracer::default();

let result_block_reward = U256::from(1000000000);
Expand All @@ -104,12 +104,12 @@ impl Engine for NullEngine {
)?;
if tracing_enabled {
tracer.trace_reward(uncle_author, result_uncle_reward, RewardType::Uncle);
}
}
}

fields.state.commit()?;
if tracing_enabled {
fields.traces.as_mut().map(|mut traces| traces.push(tracer.traces()));
fields.traces.as_mut().map(|mut traces| traces.push(tracer.drain()));
}
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/ethereum/ethash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ impl Engine for Arc<Ethash> {
// Commit state so that we can actually figure out the state root.
fields.state.commit()?;
if tracing_enabled {
fields.traces.as_mut().map(|mut traces| traces.push(tracer.traces()));
fields.traces.as_mut().map(|mut traces| traces.push(tracer.drain()));
}
Ok(())
}
Expand Down
22 changes: 0 additions & 22 deletions ethcore/src/trace/types/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,28 +219,6 @@ impl Suicide {
}
}

impl Encodable for Suicide {
fn rlp_append(&self, s: &mut RlpStream) {
s.begin_list(3);
s.append(&self.address);
s.append(&self.refund_address);
s.append(&self.balance);
}
}

impl Decodable for Suicide {
fn decode(rlp: &UntrustedRlp) -> Result<Self, DecoderError> {
let res = Suicide {
address: rlp.val_at(0)?,
refund_address: rlp.val_at(1)?,
balance: rlp.val_at(2)?,
};

Ok(res)
}
}


/// Description of an action that we trace; will be either a call or a create.
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "ipc", binary)]
Expand Down

0 comments on commit 8a420d6

Please sign in to comment.