clean up ethcore::spec module imports (#7990)

* clean up ethcore::spec module imports

* fixed missing reimport
This commit is contained in:
Marek Kotewicz 2018-02-23 19:37:23 +01:00 committed by Robert Habermeier
parent e4f863b4b0
commit 893979b5da
4 changed files with 17 additions and 25 deletions

View File

@ -15,9 +15,9 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>. // along with Parity. If not, see <http://www.gnu.org/licenses/>.
use ethereum_types::{H256, U256, Address}; use ethereum_types::{H256, U256, Address};
use hash::KECCAK_NULL_RLP;
use ethjson; use ethjson;
use super::seal::Seal; use hash::KECCAK_NULL_RLP;
use spec::seal::Seal;
/// Genesis components. /// Genesis components.
pub struct Genesis { pub struct Genesis {

View File

@ -18,7 +18,7 @@
mod genesis; mod genesis;
mod seal; mod seal;
pub mod spec; mod spec;
pub use self::spec::*;
pub use self::genesis::Genesis; pub use self::genesis::Genesis;
pub use self::spec::{Spec, SpecParams, CommonParams, OptimizeFor};

View File

@ -16,7 +16,7 @@
//! Spec seal. //! Spec seal.
use rlp::*; use rlp::RlpStream;
use ethereum_types::{H64, H256, H520}; use ethereum_types::{H64, H256, H520};
use ethjson; use ethjson;

View File

@ -16,24 +16,21 @@
//! Parameters for a block chain. //! Parameters for a block chain.
use std::io::Read;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::io::Read;
use std::path::Path; use std::path::Path;
use std::sync::Arc; use std::sync::Arc;
use ethereum_types::{H256, Bloom, U256, Address};
use memorydb::MemoryDB;
use bytes::Bytes; use bytes::Bytes;
use ethereum_types::{H256, Bloom, U256, Address};
use ethjson; use ethjson;
use hash::{KECCAK_NULL_RLP, keccak}; use hash::{KECCAK_NULL_RLP, keccak};
use memorydb::MemoryDB;
use parking_lot::RwLock; use parking_lot::RwLock;
use rlp::{Rlp, RlpStream}; use rlp::{Rlp, RlpStream};
use rustc_hex::FromHex; use rustc_hex::FromHex;
use vm::{EnvInfo, CallType, ActionValue, ActionParams, ParamsType}; use vm::{EnvInfo, CallType, ActionValue, ActionParams, ParamsType};
use super::genesis::Genesis;
use super::seal::Generic as GenericSeal;
use builtin::Builtin; use builtin::Builtin;
use engines::{EthEngine, NullEngine, InstantSeal, BasicAuthority, AuthorityRound, Tendermint, DEFAULT_BLOCKHASH_CONTRACT}; use engines::{EthEngine, NullEngine, InstantSeal, BasicAuthority, AuthorityRound, Tendermint, DEFAULT_BLOCKHASH_CONTRACT};
use error::Error; use error::Error;
@ -41,9 +38,11 @@ use executive::Executive;
use factory::Factories; use factory::Factories;
use header::{BlockNumber, Header}; use header::{BlockNumber, Header};
use machine::EthereumMachine; use machine::EthereumMachine;
use pod_state::*; use pod_state::PodState;
use state::{Backend, State, Substate}; use spec::Genesis;
use spec::seal::Generic as GenericSeal;
use state::backend::Basic as BasicBackend; use state::backend::Basic as BasicBackend;
use state::{Backend, State, Substate};
use trace::{NoopTracer, NoopVMTracer}; use trace::{NoopTracer, NoopVMTracer};
pub use ethash::OptimizeFor; pub use ethash::OptimizeFor;
@ -819,9 +818,8 @@ impl Spec {
mod tests { mod tests {
use super::*; use super::*;
use state::State; use state::State;
use std::str::FromStr;
use tests::helpers::get_temp_state_db; use tests::helpers::get_temp_state_db;
use views::*; use views::BlockView;
// https://github.com/paritytech/parity/issues/1840 // https://github.com/paritytech/parity/issues/1840
#[test] #[test]
@ -835,16 +833,12 @@ mod tests {
assert_eq!( assert_eq!(
test_spec.state_root(), test_spec.state_root(),
H256::from_str( "f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9".into()
"f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9",
).unwrap()
); );
let genesis = test_spec.genesis_block(); let genesis = test_spec.genesis_block();
assert_eq!( assert_eq!(
BlockView::new(&genesis).header_view().hash(), BlockView::new(&genesis).header_view().hash(),
H256::from_str( "0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303".into()
"0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303",
).unwrap()
); );
} }
@ -860,10 +854,8 @@ mod tests {
spec.engine.account_start_nonce(0), spec.engine.account_start_nonce(0),
Default::default(), Default::default(),
).unwrap(); ).unwrap();
let expected = H256::from_str( let expected = "0000000000000000000000000000000000000000000000000000000000000001".into();
"0000000000000000000000000000000000000000000000000000000000000001", let address = "0000000000000000000000000000000000001337".into();
).unwrap();
let address = Address::from_str("0000000000000000000000000000000000001337").unwrap();
assert_eq!(state.storage_at(&address, &H256::zero()).unwrap(), expected); assert_eq!(state.storage_at(&address, &H256::zero()).unwrap(), expected);
assert_eq!(state.balance(&address).unwrap(), 1.into()); assert_eq!(state.balance(&address).unwrap(), 1.into());