clean up ethcore::spec module imports (#7990)
* clean up ethcore::spec module imports * fixed missing reimport
This commit is contained in:
parent
e4f863b4b0
commit
893979b5da
@ -15,9 +15,9 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use ethereum_types::{H256, U256, Address};
|
||||
use hash::KECCAK_NULL_RLP;
|
||||
use ethjson;
|
||||
use super::seal::Seal;
|
||||
use hash::KECCAK_NULL_RLP;
|
||||
use spec::seal::Seal;
|
||||
|
||||
/// Genesis components.
|
||||
pub struct Genesis {
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
mod genesis;
|
||||
mod seal;
|
||||
pub mod spec;
|
||||
mod spec;
|
||||
|
||||
pub use self::spec::*;
|
||||
pub use self::genesis::Genesis;
|
||||
pub use self::spec::{Spec, SpecParams, CommonParams, OptimizeFor};
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
//! Spec seal.
|
||||
|
||||
use rlp::*;
|
||||
use rlp::RlpStream;
|
||||
use ethereum_types::{H64, H256, H520};
|
||||
use ethjson;
|
||||
|
||||
|
@ -16,24 +16,21 @@
|
||||
|
||||
//! Parameters for a block chain.
|
||||
|
||||
use std::io::Read;
|
||||
use std::collections::BTreeMap;
|
||||
use std::io::Read;
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
||||
use ethereum_types::{H256, Bloom, U256, Address};
|
||||
use memorydb::MemoryDB;
|
||||
use bytes::Bytes;
|
||||
use ethereum_types::{H256, Bloom, U256, Address};
|
||||
use ethjson;
|
||||
use hash::{KECCAK_NULL_RLP, keccak};
|
||||
use memorydb::MemoryDB;
|
||||
use parking_lot::RwLock;
|
||||
use rlp::{Rlp, RlpStream};
|
||||
use rustc_hex::FromHex;
|
||||
use vm::{EnvInfo, CallType, ActionValue, ActionParams, ParamsType};
|
||||
|
||||
use super::genesis::Genesis;
|
||||
use super::seal::Generic as GenericSeal;
|
||||
|
||||
use builtin::Builtin;
|
||||
use engines::{EthEngine, NullEngine, InstantSeal, BasicAuthority, AuthorityRound, Tendermint, DEFAULT_BLOCKHASH_CONTRACT};
|
||||
use error::Error;
|
||||
@ -41,9 +38,11 @@ use executive::Executive;
|
||||
use factory::Factories;
|
||||
use header::{BlockNumber, Header};
|
||||
use machine::EthereumMachine;
|
||||
use pod_state::*;
|
||||
use state::{Backend, State, Substate};
|
||||
use pod_state::PodState;
|
||||
use spec::Genesis;
|
||||
use spec::seal::Generic as GenericSeal;
|
||||
use state::backend::Basic as BasicBackend;
|
||||
use state::{Backend, State, Substate};
|
||||
use trace::{NoopTracer, NoopVMTracer};
|
||||
|
||||
pub use ethash::OptimizeFor;
|
||||
@ -819,9 +818,8 @@ impl Spec {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use state::State;
|
||||
use std::str::FromStr;
|
||||
use tests::helpers::get_temp_state_db;
|
||||
use views::*;
|
||||
use views::BlockView;
|
||||
|
||||
// https://github.com/paritytech/parity/issues/1840
|
||||
#[test]
|
||||
@ -835,16 +833,12 @@ mod tests {
|
||||
|
||||
assert_eq!(
|
||||
test_spec.state_root(),
|
||||
H256::from_str(
|
||||
"f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9",
|
||||
).unwrap()
|
||||
"f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9".into()
|
||||
);
|
||||
let genesis = test_spec.genesis_block();
|
||||
assert_eq!(
|
||||
BlockView::new(&genesis).header_view().hash(),
|
||||
H256::from_str(
|
||||
"0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303",
|
||||
).unwrap()
|
||||
"0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303".into()
|
||||
);
|
||||
}
|
||||
|
||||
@ -860,10 +854,8 @@ mod tests {
|
||||
spec.engine.account_start_nonce(0),
|
||||
Default::default(),
|
||||
).unwrap();
|
||||
let expected = H256::from_str(
|
||||
"0000000000000000000000000000000000000000000000000000000000000001",
|
||||
).unwrap();
|
||||
let address = Address::from_str("0000000000000000000000000000000000001337").unwrap();
|
||||
let expected = "0000000000000000000000000000000000000000000000000000000000000001".into();
|
||||
let address = "0000000000000000000000000000000000001337".into();
|
||||
|
||||
assert_eq!(state.storage_at(&address, &H256::zero()).unwrap(), expected);
|
||||
assert_eq!(state.balance(&address).unwrap(), 1.into());
|
||||
|
Loading…
Reference in New Issue
Block a user