removed util::common
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
//! Blockchain database.
|
||||
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::sync::Arc;
|
||||
use std::mem;
|
||||
use bloomchain as bc;
|
||||
use util::*;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
//! Test client.
|
||||
|
||||
use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrder};
|
||||
use std::sync::Arc;
|
||||
use std::collections::{HashMap, BTreeMap};
|
||||
use std::mem;
|
||||
use rustc_hex::FromHex;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! A blockchain engine that supports a non-instant BFT proof-of-authority.
|
||||
|
||||
use std::sync::atomic::{AtomicUsize, AtomicBool, Ordering as AtomicOrdering};
|
||||
use std::sync::Weak;
|
||||
use std::sync::{Weak, Arc};
|
||||
use std::time::{UNIX_EPOCH, Duration};
|
||||
use std::collections::{BTreeMap, HashSet, HashMap};
|
||||
use std::cmp;
|
||||
@@ -853,8 +853,8 @@ impl Engine for AuthorityRound {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrdering};
|
||||
use std::str::FromStr;
|
||||
use util::*;
|
||||
use header::Header;
|
||||
use error::{Error, BlockError};
|
||||
@@ -944,10 +944,10 @@ mod tests {
|
||||
let addr = tap.insert_account("0".sha3().into(), "0").unwrap();
|
||||
let mut parent_header: Header = Header::default();
|
||||
parent_header.set_seal(vec![encode(&0usize).into_vec()]);
|
||||
parent_header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
parent_header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
let mut header: Header = Header::default();
|
||||
header.set_number(1);
|
||||
header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
header.set_author(addr);
|
||||
|
||||
let engine = Spec::new_test_round().engine;
|
||||
@@ -970,10 +970,10 @@ mod tests {
|
||||
|
||||
let mut parent_header: Header = Header::default();
|
||||
parent_header.set_seal(vec![encode(&0usize).into_vec()]);
|
||||
parent_header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
parent_header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
let mut header: Header = Header::default();
|
||||
header.set_number(1);
|
||||
header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
header.set_author(addr);
|
||||
|
||||
let engine = Spec::new_test_round().engine;
|
||||
@@ -996,10 +996,10 @@ mod tests {
|
||||
|
||||
let mut parent_header: Header = Header::default();
|
||||
parent_header.set_seal(vec![encode(&4usize).into_vec()]);
|
||||
parent_header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
parent_header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
let mut header: Header = Header::default();
|
||||
header.set_number(1);
|
||||
header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
header.set_author(addr);
|
||||
|
||||
let engine = Spec::new_test_round().engine;
|
||||
@@ -1017,7 +1017,7 @@ mod tests {
|
||||
fn reports_skipped() {
|
||||
let last_benign = Arc::new(AtomicUsize::new(0));
|
||||
let params = AuthorityRoundParams {
|
||||
gas_limit_bound_divisor: U256::from_str("400").unwrap(),
|
||||
gas_limit_bound_divisor: "400".parse::<U256>().unwrap(),
|
||||
step_duration: Default::default(),
|
||||
block_reward: Default::default(),
|
||||
registrar: Default::default(),
|
||||
@@ -1032,10 +1032,10 @@ mod tests {
|
||||
|
||||
let mut parent_header: Header = Header::default();
|
||||
parent_header.set_seal(vec![encode(&1usize).into_vec()]);
|
||||
parent_header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
parent_header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
let mut header: Header = Header::default();
|
||||
header.set_number(1);
|
||||
header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
header.set_seal(vec![encode(&3usize).into_vec()]);
|
||||
|
||||
// Do not report when signer not present.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//! A blockchain engine that supports a basic, non-BFT proof-of-authority.
|
||||
|
||||
use std::sync::Weak;
|
||||
use std::sync::{Weak, Arc};
|
||||
use std::collections::BTreeMap;
|
||||
use std::cmp;
|
||||
use util::*;
|
||||
@@ -256,6 +256,7 @@ impl Engine for BasicAuthority {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use block::*;
|
||||
use error::{BlockError, Error};
|
||||
|
||||
@@ -65,6 +65,7 @@ impl Engine for InstantSeal {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use tests::helpers::*;
|
||||
use spec::Spec;
|
||||
|
||||
@@ -35,7 +35,7 @@ pub use self::instant_seal::InstantSeal;
|
||||
pub use self::null_engine::NullEngine;
|
||||
pub use self::tendermint::Tendermint;
|
||||
|
||||
use std::sync::Weak;
|
||||
use std::sync::{Weak, Arc};
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::fmt;
|
||||
|
||||
@@ -395,6 +395,7 @@ pub trait Engine : Sync + Send {
|
||||
|
||||
/// Common engine utilities
|
||||
pub mod common {
|
||||
use std::sync::Arc;
|
||||
use block::ExecutedBlock;
|
||||
use evm::env_info::{EnvInfo, LastHashes};
|
||||
use error::Error;
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
//! A signer used by Engines which need to sign messages.
|
||||
|
||||
use util::{Arc, H256, Address};
|
||||
use std::sync::Arc;
|
||||
use util::{H256, Address};
|
||||
use ethkey::Signature;
|
||||
use account_provider::{self, AccountProvider};
|
||||
|
||||
|
||||
@@ -199,6 +199,7 @@ pub fn message_hash(vote_step: VoteStep, block_hash: H256) -> H256 {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use rlp::*;
|
||||
use account_provider::AccountProvider;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
mod message;
|
||||
mod params;
|
||||
|
||||
use std::sync::Weak;
|
||||
use std::sync::{Weak, Arc};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrdering};
|
||||
use std::collections::{HashSet, BTreeMap, HashMap};
|
||||
use std::cmp;
|
||||
|
||||
@@ -126,6 +126,7 @@ impl ValidatorSet for ValidatorContract {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use rustc_hex::FromHex;
|
||||
use util::*;
|
||||
use rlp::encode;
|
||||
|
||||
@@ -142,6 +142,7 @@ impl ValidatorSet for Multi {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use std::collections::BTreeMap;
|
||||
use account_provider::AccountProvider;
|
||||
use client::{BlockChainClient, EngineClient};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
/// Validator set maintained in a contract, updated using `getValidators` method.
|
||||
|
||||
use std::sync::Weak;
|
||||
use std::sync::{Weak, Arc};
|
||||
use futures::Future;
|
||||
use native_contracts::ValidatorSet as Provider;
|
||||
|
||||
@@ -422,6 +422,7 @@ impl ValidatorSet for ValidatorSafeContract {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use rustc_hex::FromHex;
|
||||
use util::*;
|
||||
use types::ids::BlockId;
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
/// Used for Engine testing.
|
||||
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrdering};
|
||||
use util::{Arc, Bytes, H256, Address, HeapSizeOf};
|
||||
use util::{Bytes, H256, Address, HeapSizeOf};
|
||||
|
||||
use engines::{Call, Engine};
|
||||
use header::{Header, BlockNumber};
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::collections::{BTreeMap, HashSet, HashMap};
|
||||
use std::hash::Hash;
|
||||
use util::*;
|
||||
use rlp::{Encodable, RlpStream};
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
use std::path::Path;
|
||||
use std::cmp;
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::sync::Arc;
|
||||
use ethash::{quick_get_difficulty, slow_get_seedhash, EthashManager};
|
||||
use util::*;
|
||||
use block::*;
|
||||
@@ -563,6 +564,7 @@ impl Header {
|
||||
mod tests {
|
||||
use std::str::FromStr;
|
||||
use std::collections::BTreeMap;
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use block::*;
|
||||
use tests::helpers::*;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
//! Transaction Execution environment.
|
||||
use std::cmp;
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use evm::action_params::{ActionParams, ActionValue};
|
||||
use state::{Backend as StateBackend, State, Substate, CleanupMode};
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
//! Transaction Execution environment.
|
||||
use std::cmp;
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use evm::action_params::{ActionParams, ActionValue};
|
||||
use state::{Backend as StateBackend, State, Substate, CleanupMode};
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
use std::time::{Instant, Duration};
|
||||
use std::collections::{BTreeMap, HashSet};
|
||||
use std::sync::Arc;
|
||||
|
||||
use util::*;
|
||||
use using_queue::{UsingQueue, GetAction};
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
//! Creates and registers client and network services.
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::path::Path;
|
||||
use util::*;
|
||||
use io::*;
|
||||
use spec::Spec;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
use std::io::Read;
|
||||
use std::collections::BTreeMap;
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
use rustc_hex::FromHex;
|
||||
use super::genesis::Genesis;
|
||||
use super::seal::Generic as GenericSeal;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
//! Single account in the system.
|
||||
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use std::collections::HashMap;
|
||||
use util::*;
|
||||
use pod_account::*;
|
||||
|
||||
@@ -23,6 +23,7 @@ use std::cell::{RefCell, RefMut};
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::{HashMap, BTreeMap, HashSet};
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
||||
use receipt::Receipt;
|
||||
use engines::Engine;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::collections::{VecDeque, HashSet};
|
||||
use std::sync::Arc;
|
||||
use lru_cache::LruCache;
|
||||
use util::cache::MemoryLruCache;
|
||||
use util::journaldb::JournalDB;
|
||||
@@ -23,7 +24,7 @@ use util::hash::{H256};
|
||||
use util::hashdb::HashDB;
|
||||
use state::{self, Account};
|
||||
use header::BlockNumber;
|
||||
use util::{Arc, Address, DBTransaction, UtilError, Mutex, Hashable};
|
||||
use util::{Address, DBTransaction, UtilError, Mutex, Hashable};
|
||||
use bloom_journal::{Bloom, BloomJournal};
|
||||
use db::COL_ACCOUNT_BLOOM;
|
||||
use byteorder::{LittleEndian, ByteOrder};
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use io::IoChannel;
|
||||
use client::{BlockChainClient, MiningBlockChainClient, Client, ClientConfig, BlockId};
|
||||
use state::{self, State, CleanupMode};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
//! Tests of EVM integration with transaction execution.
|
||||
|
||||
use std::sync::Arc;
|
||||
use evm::action_params::{ActionParams, ActionValue};
|
||||
use evm::env_info::EnvInfo;
|
||||
use evm::{Factory, VMType};
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use std::sync::Arc;
|
||||
use ethkey::KeyPair;
|
||||
use io::*;
|
||||
use client::{BlockChainClient, Client, ClientConfig};
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
use std::thread::{self, JoinHandle};
|
||||
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering as AtomicOrdering};
|
||||
use std::sync::{Condvar as SCondvar, Mutex as SMutex};
|
||||
use std::sync::{Condvar as SCondvar, Mutex as SMutex, Arc};
|
||||
use std::cmp;
|
||||
use std::collections::{VecDeque, HashSet, HashMap};
|
||||
use util::*;
|
||||
|
||||
Reference in New Issue
Block a user