removed util::common
This commit is contained in:
parent
eecd823d32
commit
c4989ddc44
@ -33,13 +33,14 @@
|
||||
|
||||
use std::io;
|
||||
use std::{fmt, mem, time};
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::collections::VecDeque;
|
||||
|
||||
use futures::{self, Future, BoxFuture};
|
||||
use futures_cpupool::CpuPool;
|
||||
use ntp;
|
||||
use time::{Duration, Timespec};
|
||||
use util::{Arc, RwLock};
|
||||
use util::RwLock;
|
||||
|
||||
/// Time checker error.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
//! Interface for Evm externalities.
|
||||
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use call_type::CallType;
|
||||
use env_info::EnvInfo;
|
||||
|
@ -25,6 +25,7 @@ mod shared_cache;
|
||||
|
||||
use std::marker::PhantomData;
|
||||
use std::{cmp, mem};
|
||||
use std::sync::Arc;
|
||||
use self::gasometer::Gasometer;
|
||||
use self::stack::{Stack, VecStack};
|
||||
use self::memory::Memory;
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::str::FromStr;
|
||||
use std::hash::Hash;
|
||||
use std::sync::Arc;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use rustc_hex::FromHex;
|
||||
use util::*;
|
||||
|
@ -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::*;
|
||||
|
@ -63,11 +63,10 @@ pub struct AuthorityRound {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use util::{H160, U256};
|
||||
use uint::Uint;
|
||||
use util::U256;
|
||||
use util::H160;
|
||||
use serde_json;
|
||||
use hash::Address;
|
||||
use serde_json;
|
||||
use spec::validator_set::ValidatorSet;
|
||||
use spec::authority_round::AuthorityRound;
|
||||
|
||||
|
@ -18,8 +18,7 @@
|
||||
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::collections::hash_map::Entry;
|
||||
use util::{Address, H256, Bytes, U256};
|
||||
use util::standard::*;
|
||||
use util::{Address, H256, Bytes, U256, RwLock, Mutex};
|
||||
use ethcore::error::{Error, CallError};
|
||||
use ethcore::client::{MiningBlockChainClient, Executed, CallAnalytics};
|
||||
use ethcore::block::{ClosedBlock, IsBlock};
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use util::*;
|
||||
use std::sync::Arc;
|
||||
use ethcore::client::{TestBlockChainClient, BlockChainClient, BlockId, EachBlockWith};
|
||||
use chain::{SyncState};
|
||||
use super::helpers::*;
|
||||
|
@ -14,6 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use io::{IoHandler, IoContext, IoChannel};
|
||||
use ethcore::client::{BlockChainClient, Client};
|
||||
|
@ -15,6 +15,7 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::collections::{VecDeque, HashSet, HashMap};
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use network::*;
|
||||
use tests::snapshot::*;
|
||||
|
@ -15,6 +15,7 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use ethcore::snapshot::{SnapshotService, ManifestData, RestorationStatus};
|
||||
use ethcore::header::BlockNumber;
|
||||
|
@ -16,9 +16,10 @@
|
||||
|
||||
use super::*;
|
||||
use std::sync::atomic::{AtomicBool, Ordering as AtomicOrdering};
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
use std::time::*;
|
||||
use util::common::*;
|
||||
use util::{Bytes, Mutex};
|
||||
use io::TimerToken;
|
||||
use ethkey::{Random, Generator};
|
||||
|
||||
|
@ -17,13 +17,6 @@
|
||||
//! Utils common types and macros global reexport.
|
||||
|
||||
use std::io;
|
||||
pub use standard::*;
|
||||
pub use error::*;
|
||||
pub use bytes::*;
|
||||
pub use vector::*;
|
||||
pub use sha3::*;
|
||||
pub use bigint::prelude::*;
|
||||
pub use bigint::hash;
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! vec_into {
|
||||
@ -89,8 +82,8 @@ macro_rules! map_into {
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! flush {
|
||||
($arg:expr) => ($crate::flush($arg.into()));
|
||||
($($arg:tt)*) => ($crate::flush(format!("{}", format_args!($($arg)*))));
|
||||
($arg:expr) => ($crate::common::flush($arg.into()));
|
||||
($($arg:tt)*) => ($crate::common::flush(format!("{}", format_args!($($arg)*))));
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
|
@ -19,7 +19,7 @@
|
||||
use rustc_hex::FromHexError;
|
||||
use rlp::DecoderError;
|
||||
use std::fmt;
|
||||
use hash::H256;
|
||||
use bigint::hash::H256;
|
||||
|
||||
#[derive(Debug)]
|
||||
/// Error in database subsystem.
|
||||
|
@ -17,13 +17,14 @@
|
||||
//! Disk-backed `HashDB` implementation.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use common::*;
|
||||
use std::sync::Arc;
|
||||
use rlp::*;
|
||||
use hashdb::*;
|
||||
use memorydb::*;
|
||||
use super::{DB_PREFIX_LEN, LATEST_ERA_KEY};
|
||||
use super::traits::JournalDB;
|
||||
use kvdb::{KeyValueDB, DBTransaction};
|
||||
use {Bytes, H256, BaseDataError, UtilError};
|
||||
|
||||
/// Implementation of the `HashDB` trait for a disk-backed database with a memory overlay
|
||||
/// and latent-removal semantics.
|
||||
@ -197,11 +198,12 @@ mod tests {
|
||||
#![cfg_attr(feature="dev", allow(blacklisted_name))]
|
||||
#![cfg_attr(feature="dev", allow(similar_names))]
|
||||
|
||||
use common::*;
|
||||
use std::path::Path;
|
||||
use hashdb::{HashDB, DBValue};
|
||||
use super::*;
|
||||
use journaldb::traits::JournalDB;
|
||||
use kvdb::Database;
|
||||
use {Hashable, H32};
|
||||
|
||||
#[test]
|
||||
fn insert_same_in_fork() {
|
||||
|
@ -18,13 +18,17 @@
|
||||
|
||||
use std::fmt;
|
||||
use std::collections::HashMap;
|
||||
use common::*;
|
||||
use std::sync::Arc;
|
||||
use parking_lot::RwLock;
|
||||
use heapsize::HeapSizeOf;
|
||||
use itertools::Itertools;
|
||||
use rlp::*;
|
||||
use hashdb::*;
|
||||
use memorydb::*;
|
||||
use super::{DB_PREFIX_LEN, LATEST_ERA_KEY};
|
||||
use super::traits::JournalDB;
|
||||
use kvdb::{KeyValueDB, DBTransaction};
|
||||
use {H256, BaseDataError, UtilError, Bytes};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
struct RefInfo {
|
||||
@ -551,12 +555,13 @@ mod tests {
|
||||
#![cfg_attr(feature="dev", allow(blacklisted_name))]
|
||||
#![cfg_attr(feature="dev", allow(similar_names))]
|
||||
|
||||
use common::*;
|
||||
use std::path::Path;
|
||||
use hashdb::{HashDB, DBValue};
|
||||
use super::*;
|
||||
use super::super::traits::JournalDB;
|
||||
use ethcore_logger::init_log;
|
||||
use kvdb::{DatabaseConfig};
|
||||
use {Hashable, H32};
|
||||
|
||||
#[test]
|
||||
fn insert_same_in_fork() {
|
||||
|
@ -17,7 +17,7 @@
|
||||
//! `JournalDB` interface and implementation.
|
||||
|
||||
use std::{fmt, str};
|
||||
use common::*;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Export the journaldb module.
|
||||
pub mod traits;
|
||||
|
@ -17,13 +17,16 @@
|
||||
//! `JournalDB` over in-memory overlay
|
||||
|
||||
use std::collections::HashMap;
|
||||
use common::*;
|
||||
use std::sync::Arc;
|
||||
use parking_lot::RwLock;
|
||||
use heapsize::HeapSizeOf;
|
||||
use rlp::*;
|
||||
use hashdb::*;
|
||||
use memorydb::*;
|
||||
use super::{DB_PREFIX_LEN, LATEST_ERA_KEY};
|
||||
use kvdb::{KeyValueDB, DBTransaction};
|
||||
use super::JournalDB;
|
||||
use {H256, BaseDataError, UtilError, Bytes, H256FastMap};
|
||||
|
||||
/// Implementation of the `JournalDB` trait for a disk-backed database with a memory overlay
|
||||
/// and, possibly, latent-removal semantics.
|
||||
@ -451,12 +454,13 @@ mod tests {
|
||||
#![cfg_attr(feature="dev", allow(blacklisted_name))]
|
||||
#![cfg_attr(feature="dev", allow(similar_names))]
|
||||
|
||||
use common::*;
|
||||
use std::path::Path;
|
||||
use super::*;
|
||||
use hashdb::{HashDB, DBValue};
|
||||
use ethcore_logger::init_log;
|
||||
use journaldb::JournalDB;
|
||||
use kvdb::Database;
|
||||
use {H32, Hashable};
|
||||
|
||||
fn new_db(path: &Path) -> OverlayRecentDB {
|
||||
let backing = Arc::new(Database::open_default(path.to_str().unwrap()).unwrap());
|
||||
|
@ -17,7 +17,8 @@
|
||||
//! Disk-backed, ref-counted `JournalDB` implementation.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use common::*;
|
||||
use std::sync::Arc;
|
||||
use heapsize::HeapSizeOf;
|
||||
use rlp::*;
|
||||
use hashdb::*;
|
||||
use overlaydb::OverlayDB;
|
||||
@ -25,6 +26,7 @@ use memorydb::MemoryDB;
|
||||
use super::{DB_PREFIX_LEN, LATEST_ERA_KEY};
|
||||
use super::traits::JournalDB;
|
||||
use kvdb::{KeyValueDB, DBTransaction};
|
||||
use {UtilError, H256, Bytes};
|
||||
|
||||
/// Implementation of the `HashDB` trait for a disk-backed database with a memory overlay
|
||||
/// and latent-removal semantics.
|
||||
@ -211,10 +213,10 @@ mod tests {
|
||||
#![cfg_attr(feature="dev", allow(blacklisted_name))]
|
||||
#![cfg_attr(feature="dev", allow(similar_names))]
|
||||
|
||||
use common::*;
|
||||
use hashdb::{HashDB, DBValue};
|
||||
use super::*;
|
||||
use super::super::traits::JournalDB;
|
||||
use {Hashable};
|
||||
|
||||
#[test]
|
||||
fn long_history() {
|
||||
|
@ -16,9 +16,10 @@
|
||||
|
||||
//! Disk-backed `HashDB` implementation.
|
||||
|
||||
use common::*;
|
||||
use std::sync::Arc;
|
||||
use hashdb::*;
|
||||
use kvdb::{self, DBTransaction};
|
||||
use {Bytes, H256, UtilError};
|
||||
|
||||
/// A `HashDB` which can manage a short-term journal potentially containing many forks of mutually
|
||||
/// exclusive actions.
|
||||
|
@ -20,14 +20,17 @@ use std::{mem, fs};
|
||||
use std::collections::{HashMap, BTreeMap};
|
||||
use std::io::ErrorKind;
|
||||
use std::marker::PhantomData;
|
||||
use std::path::PathBuf;
|
||||
use std::path::{PathBuf, Path};
|
||||
use parking_lot::{Mutex, MutexGuard, RwLock};
|
||||
|
||||
use common::*;
|
||||
use elastic_array::*;
|
||||
use hashdb::DBValue;
|
||||
use rlp::{UntrustedRlp, RlpType, Compressible};
|
||||
use rocksdb::{DB, Writable, WriteBatch, WriteOptions, IteratorMode, DBIterator,
|
||||
Options, DBCompactionStyle, BlockBasedOptions, Direction, Cache, Column, ReadOptions};
|
||||
use {UtilError, Bytes};
|
||||
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
use regex::Regex;
|
||||
#[cfg(target_os = "linux")]
|
||||
|
@ -112,7 +112,6 @@ extern crate ethcore_logger;
|
||||
#[macro_use]
|
||||
extern crate log as rlog;
|
||||
|
||||
pub mod standard;
|
||||
#[macro_use]
|
||||
pub mod common;
|
||||
pub mod error;
|
||||
@ -135,7 +134,6 @@ pub mod snappy;
|
||||
pub mod cache;
|
||||
mod timer;
|
||||
|
||||
pub use common::*;
|
||||
pub use misc::*;
|
||||
pub use hashdb::*;
|
||||
pub use memorydb::MemoryDB;
|
||||
@ -146,7 +144,17 @@ pub use trie::{Trie, TrieMut, TrieDB, TrieDBMut, TrieFactory, TrieError, SecTrie
|
||||
pub use semantic_version::*;
|
||||
pub use kvdb::*;
|
||||
pub use timer::*;
|
||||
pub use error::*;
|
||||
pub use bytes::*;
|
||||
pub use vector::*;
|
||||
pub use sha3::*;
|
||||
pub use bigint::prelude::*;
|
||||
pub use bigint::hash;
|
||||
|
||||
pub use ansi_term::{Colour, Style};
|
||||
pub use heapsize::HeapSizeOf;
|
||||
pub use itertools::Itertools;
|
||||
pub use parking_lot::{Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
|
||||
|
||||
/// 160-bit integer representing account address
|
||||
pub type Address = H160;
|
||||
|
@ -19,12 +19,11 @@
|
||||
//! are performed in temp sub-directories.
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use common::*;
|
||||
use std::sync::Arc;
|
||||
use std::path::{Path, PathBuf};
|
||||
use migration::{Batch, Config, Error, SimpleMigration, Migration, Manager};
|
||||
use kvdb::Database;
|
||||
|
||||
use devtools::RandomTempPath;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn db_path(path: &Path) -> PathBuf {
|
||||
let mut p = path.to_owned();
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
//! Diff misc.
|
||||
|
||||
use common::*;
|
||||
use rlp::RlpStream;
|
||||
use target_info::Target;
|
||||
use Bytes;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/version.rs"));
|
||||
include!(concat!(env!("OUT_DIR"), "/rustc_version.rs"));
|
||||
|
@ -1,27 +0,0 @@
|
||||
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity.
|
||||
|
||||
// Parity is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Std lib global reexports.
|
||||
|
||||
pub use std::path::Path;
|
||||
pub use std::hash::{Hash, Hasher};
|
||||
|
||||
pub use std::sync::Arc;
|
||||
|
||||
pub use heapsize::HeapSizeOf;
|
||||
pub use itertools::Itertools;
|
||||
|
||||
pub use parking_lot::{Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
|
@ -15,13 +15,14 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::fmt;
|
||||
use common::*;
|
||||
use itertools::Itertools;
|
||||
use hashdb::*;
|
||||
use nibbleslice::*;
|
||||
use rlp::*;
|
||||
use super::node::{Node, OwnedNode};
|
||||
use super::lookup::Lookup;
|
||||
use super::{Trie, TrieItem, TrieError, TrieIterator, Query};
|
||||
use {ToPretty, Bytes, H256};
|
||||
|
||||
/// A `Trie` implementation using a generic `HashDB` backing database.
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user