From 141c2fd34aa30fc6cf400b11f8bfbcfaa4e0d823 Mon Sep 17 00:00:00 2001 From: Anton Gavrilov Date: Mon, 31 Jul 2017 18:10:06 +0200 Subject: [PATCH] Fixed comments after review and test after rebase --- ethcore/res/null_morden_with_reward.json | 1 + ethcore/src/block.rs | 2 +- ethcore/src/engines/authority_round/mod.rs | 2 +- ethcore/src/engines/null_engine.rs | 4 ++-- ethcore/src/engines/tendermint/mod.rs | 2 +- ethcore/src/ethereum/ethash.rs | 4 ++-- ethcore/src/spec/spec.rs | 7 ------- 7 files changed, 8 insertions(+), 14 deletions(-) diff --git a/ethcore/res/null_morden_with_reward.json b/ethcore/res/null_morden_with_reward.json index cf22092c4..1ddcad1a8 100644 --- a/ethcore/res/null_morden_with_reward.json +++ b/ethcore/res/null_morden_with_reward.json @@ -4,6 +4,7 @@ "null": null }, "params": { + "gasLimitBoundDivisor": "0x0400", "accountStartNonce": "0x0", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", diff --git a/ethcore/src/block.rs b/ethcore/src/block.rs index 9057155db..d23bdbc6f 100644 --- a/ethcore/src/block.rs +++ b/ethcore/src/block.rs @@ -206,7 +206,7 @@ pub trait IsBlock { fn uncles(&self) -> &[Header] { &self.block().uncles } /// Get tracing enabled flag for this block. - fn tracing_enabled(&self) -> &bool { &self.block().tracing_enabled } + fn tracing_enabled(&self) -> bool { self.block().tracing_enabled } } /// Trait for a object that has a state database. diff --git a/ethcore/src/engines/authority_round/mod.rs b/ethcore/src/engines/authority_round/mod.rs index 8f2b94e70..981cc45d2 100644 --- a/ethcore/src/engines/authority_round/mod.rs +++ b/ethcore/src/engines/authority_round/mod.rs @@ -555,7 +555,7 @@ impl Engine for AuthorityRound { // Trace it let block_miner = fields.header.author().clone(); - tracer.trace_reward(block_miner, self.block_reward, RewardType::Block); + tracer.trace_reward(block_miner, self.params().block_reward, RewardType::Block); // Commit state so that we can actually figure out the state root. if let Err(ref e) = res { diff --git a/ethcore/src/engines/null_engine.rs b/ethcore/src/engines/null_engine.rs index 0a31afc0e..cb22e7661 100644 --- a/ethcore/src/engines/null_engine.rs +++ b/ethcore/src/engines/null_engine.rs @@ -17,8 +17,8 @@ use std::collections::BTreeMap; use util::Address; use builtin::Builtin; -use block::*; -use util::*; +use block::{ExecutedBlock, }; +use util::U256; use engines::{Engine, CloseOutcome}; use spec::CommonParams; use evm::Schedule; diff --git a/ethcore/src/engines/tendermint/mod.rs b/ethcore/src/engines/tendermint/mod.rs index a88a903eb..2d40c0314 100644 --- a/ethcore/src/engines/tendermint/mod.rs +++ b/ethcore/src/engines/tendermint/mod.rs @@ -550,7 +550,7 @@ impl Engine for Tendermint { // Trace it let block_miner = fields.header.author().clone(); - tracer.trace_reward(block_miner, self.block_reward, RewardType::Block); + tracer.trace_reward(block_miner, self.params().block_reward, RewardType::Block); // Commit state so that we can actually figure out the state root. if let Err(ref e) = res { diff --git a/ethcore/src/ethereum/ethash.rs b/ethcore/src/ethereum/ethash.rs index d0560a2bf..95a7554aa 100644 --- a/ethcore/src/ethereum/ethash.rs +++ b/ethcore/src/ethereum/ethash.rs @@ -301,14 +301,14 @@ impl Engine for Arc { result_uncle_reward = reward * U256::from(8 + u.number() - current_number) / U256::from(8); fields.state.add_balance( u.author(), - &(result_uncle_reward), + &result_uncle_reward, CleanupMode::NoEmpty ) } else { result_uncle_reward = reward / U256::from(32); fields.state.add_balance( u.author(), - &(result_uncle_reward), + &result_uncle_reward, CleanupMode::NoEmpty ) }?; diff --git a/ethcore/src/spec/spec.rs b/ethcore/src/spec/spec.rs index bb81300d0..b50b81095 100644 --- a/ethcore/src/spec/spec.rs +++ b/ethcore/src/spec/spec.rs @@ -168,17 +168,10 @@ impl From for CommonParams { nonce_cap_increment: p.nonce_cap_increment.map_or(64, Into::into), remove_dust_contracts: p.remove_dust_contracts.unwrap_or(false), wasm: p.wasm.unwrap_or(false), -<<<<<<< HEAD -<<<<<<< HEAD gas_limit_bound_divisor: p.gas_limit_bound_divisor.into(), block_reward: p.block_reward.map_or_else(U256::zero, Into::into), registrar: p.registrar.map_or_else(Address::new, Into::into), -======= apply_reward: p.apply_reward.unwrap_or(true), ->>>>>>> 7312803... Working test with block reward added -======= - apply_reward: p.apply_reward.unwrap_or(true), ->>>>>>> bb043ba2fdcc2b5d049ca8c5f5db233cc5f82aaf } } }