fixed merge

This commit is contained in:
debris 2017-08-30 14:37:02 +02:00
parent 88200a1193
commit 8a420d6580
4 changed files with 7 additions and 29 deletions

View File

@ -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)
@ -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.

View File

@ -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);
@ -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(())
}

View File

@ -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(())
}

View File

@ -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)]