diff --git a/Cargo.lock b/Cargo.lock
index 97cb5d193..4baf2a786 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,5 +1,11 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+[[package]]
+name = "adler32"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
+
[[package]]
name = "aes"
version = "0.3.2"
@@ -438,6 +444,9 @@ name = "common-types"
version = "0.1.0"
dependencies = [
"ethereum-types",
+ "ethkey",
+ "hex",
+ "inflate",
"keccak-hash",
"parity-bytes",
"parity-crypto",
@@ -1804,6 +1813,12 @@ dependencies = [
"libc",
]
+[[package]]
+name = "hex"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
+
[[package]]
name = "hex-literal"
version = "0.2.1"
@@ -2056,6 +2071,15 @@ dependencies = [
"autocfg 0.1.7",
]
+[[package]]
+name = "inflate"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff"
+dependencies = [
+ "adler32",
+]
+
[[package]]
name = "interleaved-ordered"
version = "0.1.1"
diff --git a/bin/oe/account.rs b/bin/oe/account.rs
index 430dd2a19..0bd87cdbd 100644
--- a/bin/oe/account.rs
+++ b/bin/oe/account.rs
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with OpenEthereum. If not, see .
-use params::SpecType;
+use crate::params::SpecType;
use std::num::NonZeroU32;
#[derive(Debug, PartialEq)]
@@ -53,9 +53,11 @@ pub fn execute(_cmd: AccountCmd) -> Result {
#[cfg(feature = "accounts")]
mod command {
use super::*;
- use accounts::{AccountProvider, AccountProviderSettings};
+ use crate::{
+ accounts::{AccountProvider, AccountProviderSettings},
+ helpers::{password_from_file, password_prompt},
+ };
use ethstore::{accounts_dir::RootDiskDirectory, import_account, import_accounts, EthStore};
- use helpers::{password_from_file, password_prompt};
use std::path::PathBuf;
pub fn execute(cmd: AccountCmd) -> Result {
diff --git a/bin/oe/account_utils.rs b/bin/oe/account_utils.rs
index 902e557cc..405aa917c 100644
--- a/bin/oe/account_utils.rs
+++ b/bin/oe/account_utils.rs
@@ -21,7 +21,7 @@ use dir::Directories;
use ethereum_types::{Address, H160};
use ethkey::Password;
-use params::{AccountsConfig, SpecType};
+use crate::params::{AccountsConfig, SpecType};
#[cfg(not(feature = "accounts"))]
mod accounts {
@@ -71,10 +71,10 @@ mod accounts {
#[cfg(feature = "accounts")]
mod accounts {
use super::*;
+ use crate::upgrade::upgrade_key_location;
use std::str::FromStr;
- use upgrade::upgrade_key_location;
- pub use accounts::AccountProvider;
+ pub use crate::accounts::AccountProvider;
/// Pops along with error messages when a password is missing or invalid.
const VERIFY_PASSWORD_HINT: &str = "Make sure valid password is present in files passed using `--password` or in the configuration file.";
@@ -87,7 +87,7 @@ mod accounts {
cfg: AccountsConfig,
passwords: &[Password],
) -> Result {
- use accounts::AccountProviderSettings;
+ use crate::accounts::AccountProviderSettings;
use ethstore::{accounts_dir::RootDiskDirectory, EthStore};
let path = dirs.keys_path(data_dir);
diff --git a/bin/oe/blockchain.rs b/bin/oe/blockchain.rs
index f101aa869..d7f585758 100644
--- a/bin/oe/blockchain.rs
+++ b/bin/oe/blockchain.rs
@@ -16,10 +16,18 @@
use std::{fs, io, sync::Arc, time::Instant};
+use crate::{
+ bytes::ToPretty,
+ cache::CacheConfig,
+ db,
+ hash::{keccak, KECCAK_NULL_RLP},
+ helpers::{execute_upgrades, to_client_config},
+ informant::{FullNodeInformantData, Informant, MillisecondDuration},
+ params::{fatdb_switch_to_bool, tracing_switch_to_bool, Pruning, SpecType, Switch},
+ types::data_format::DataFormat,
+ user_defaults::UserDefaults,
+};
use ansi_term::Colour;
-use bytes::ToPretty;
-use cache::CacheConfig;
-use db;
use dir::Directories;
use ethcore::{
client::{
@@ -31,12 +39,6 @@ use ethcore::{
};
use ethcore_service::ClientService;
use ethereum_types::{Address, H256, U256};
-use hash::{keccak, KECCAK_NULL_RLP};
-use helpers::{execute_upgrades, to_client_config};
-use informant::{FullNodeInformantData, Informant, MillisecondDuration};
-use params::{fatdb_switch_to_bool, tracing_switch_to_bool, Pruning, SpecType, Switch};
-use types::data_format::DataFormat;
-use user_defaults::UserDefaults;
#[derive(Debug, PartialEq)]
pub enum BlockchainCmd {
diff --git a/bin/oe/configuration.rs b/bin/oe/configuration.rs
index 84c83bca8..1e3743c5c 100644
--- a/bin/oe/configuration.rs
+++ b/bin/oe/configuration.rs
@@ -14,9 +14,16 @@
// You should have received a copy of the GNU General Public License
// along with OpenEthereum. If not, see .
+use crate::{
+ bytes::Bytes,
+ cli::{Args, ArgsError},
+ hash::keccak,
+ metrics::MetricsConfiguration,
+ miner::pool,
+ sync::{self, validate_node_url, NetworkConfiguration},
+};
use ansi_term::Colour;
-use bytes::Bytes;
-use cli::{Args, ArgsError};
+
use crypto::publickey::{Public, Secret};
use ethcore::{
client::VMType,
@@ -25,9 +32,7 @@ use ethcore::{
verification::queue::VerifierSettings,
};
use ethereum_types::{Address, H256, U256};
-use hash::keccak;
-use metrics::MetricsConfiguration;
-use miner::pool;
+
use num_cpus;
use parity_version::{version, version_data};
use std::{
@@ -40,35 +45,37 @@ use std::{
path::PathBuf,
time::Duration,
};
-use sync::{self, validate_node_url, NetworkConfiguration};
-use account::{AccountCmd, ImportAccounts, ListAccounts, NewAccount};
-use blockchain::{
- BlockchainCmd, ExportBlockchain, ExportState, ImportBlockchain, KillBlockchain, ResetBlockchain,
+use crate::{
+ account::{AccountCmd, ImportAccounts, ListAccounts, NewAccount},
+ blockchain::{
+ BlockchainCmd, ExportBlockchain, ExportState, ImportBlockchain, KillBlockchain,
+ ResetBlockchain,
+ },
+ cache::CacheConfig,
+ helpers::{
+ parity_ipc_path, to_address, to_addresses, to_block_id, to_bootnodes, to_duration, to_mode,
+ to_pending_set, to_price, to_queue_penalization, to_queue_strategy, to_u256,
+ },
+ network::IpFilter,
+ params::{AccountsConfig, GasPricerConfig, MinerExtras, ResealPolicy, SpecType},
+ presale::ImportWallet,
+ rpc::{HttpConfiguration, IpcConfiguration, WsConfiguration},
+ run::RunCmd,
+ secretstore::{
+ Configuration as SecretStoreConfiguration, ContractAddress as SecretStoreContractAddress,
+ NodeSecretKey,
+ },
+ snapshot::{self, SnapshotCommand},
+ types::data_format::DataFormat,
};
-use cache::CacheConfig;
use dir::{
self, default_data_path, default_local_path,
helpers::{replace_home, replace_home_and_local},
Directories,
};
use ethcore_logger::Config as LogConfig;
-use helpers::{
- parity_ipc_path, to_address, to_addresses, to_block_id, to_bootnodes, to_duration, to_mode,
- to_pending_set, to_price, to_queue_penalization, to_queue_strategy, to_u256,
-};
-use network::IpFilter;
-use params::{AccountsConfig, GasPricerConfig, MinerExtras, ResealPolicy, SpecType};
use parity_rpc::NetworkSettings;
-use presale::ImportWallet;
-use rpc::{HttpConfiguration, IpcConfiguration, WsConfiguration};
-use run::RunCmd;
-use secretstore::{
- Configuration as SecretStoreConfiguration, ContractAddress as SecretStoreContractAddress,
- NodeSecretKey,
-};
-use snapshot::{self, SnapshotCommand};
-use types::data_format::DataFormat;
const DEFAULT_MAX_PEERS: u16 = 50;
const DEFAULT_MIN_PEERS: u16 = 25;
@@ -166,7 +173,7 @@ impl Configuration {
let cmd = if self.args.flag_version {
Cmd::Version
} else if self.args.cmd_signer {
- let authfile = ::signer::codes_path(&ws_conf.signer_path);
+ let authfile = crate::signer::codes_path(&ws_conf.signer_path);
if self.args.cmd_signer_new_token {
Cmd::SignerToken(ws_conf, logger_config.clone())
@@ -1243,23 +1250,25 @@ fn into_secretstore_service_contract_address(
mod tests {
use std::{fs::File, io::Write, str::FromStr};
- use account::{AccountCmd, ImportAccounts, ListAccounts, NewAccount};
- use blockchain::{BlockchainCmd, ExportBlockchain, ExportState, ImportBlockchain};
- use cli::Args;
+ use crate::{
+ account::{AccountCmd, ImportAccounts, ListAccounts, NewAccount},
+ blockchain::{BlockchainCmd, ExportBlockchain, ExportState, ImportBlockchain},
+ cli::Args,
+ helpers::default_network_config,
+ miner::pool::PrioritizationStrategy,
+ params::SpecType,
+ presale::ImportWallet,
+ rpc::WsConfiguration,
+ rpc_apis::ApiSet,
+ run::RunCmd,
+ types::{data_format::DataFormat, ids::BlockId},
+ };
use dir::Directories;
use ethcore::{client::VMType, miner::MinerOptions};
- use helpers::default_network_config;
- use miner::pool::PrioritizationStrategy;
- use params::SpecType;
use parity_rpc::NetworkSettings;
- use presale::ImportWallet;
- use rpc::WsConfiguration;
- use rpc_apis::ApiSet;
- use run::RunCmd;
use tempdir::TempDir;
- use types::{data_format::DataFormat, ids::BlockId};
- use network::{AllowIP, IpFilter};
+ use crate::network::{AllowIP, IpFilter};
extern crate ipnetwork;
use self::ipnetwork::IpNetwork;
diff --git a/bin/oe/helpers.rs b/bin/oe/helpers.rs
index e9cdf93df..688ba25e4 100644
--- a/bin/oe/helpers.rs
+++ b/bin/oe/helpers.rs
@@ -14,8 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with OpenEthereum. If not, see .
-use cache::CacheConfig;
-use db::migrate;
+use crate::{
+ cache::CacheConfig,
+ db::migrate,
+ miner::pool::PrioritizationStrategy,
+ sync::{self, validate_node_url},
+ upgrade::{upgrade, upgrade_data_paths},
+};
use dir::{helpers::replace_home, DatabaseDirectories};
use ethcore::{
client::{BlockId, ClientConfig, DatabaseCompactionProfile, Mode, VMType, VerifierType},
@@ -24,7 +29,6 @@ use ethcore::{
use ethereum_types::{Address, U256};
use ethkey::Password;
use journaldb::Algorithm;
-use miner::pool::PrioritizationStrategy;
use std::{
collections::HashSet,
fs::File,
@@ -32,8 +36,6 @@ use std::{
io::{BufRead, BufReader, Write},
time::Duration,
};
-use sync::{self, validate_node_url};
-use upgrade::{upgrade, upgrade_data_paths};
pub fn to_duration(s: &str) -> Result {
to_seconds(s).map(Duration::from_secs)
@@ -223,9 +225,9 @@ pub fn to_bootnodes(bootnodes: &Option) -> Result, String> {
}
#[cfg(test)]
-pub fn default_network_config() -> ::sync::NetworkConfiguration {
+pub fn default_network_config() -> crate::sync::NetworkConfiguration {
use super::network::IpFilter;
- use sync::NetworkConfiguration;
+ use crate::sync::NetworkConfiguration;
NetworkConfiguration {
config_path: Some(replace_home(&::dir::default_data_path(), "$BASE/network")),
net_config_path: None,
diff --git a/bin/oe/informant.rs b/bin/oe/informant.rs
index 45d8eb354..ae205f6fc 100644
--- a/bin/oe/informant.rs
+++ b/bin/oe/informant.rs
@@ -29,6 +29,11 @@ use std::{
time::{Duration, Instant},
};
+use crate::{
+ io::{IoContext, IoHandler, TimerToken},
+ sync::{ManageNetwork, SyncProvider},
+ types::BlockNumber,
+};
use atty;
use ethcore::{
client::{
@@ -37,12 +42,9 @@ use ethcore::{
},
snapshot::{service::Service as SnapshotService, RestorationStatus, SnapshotService as SS},
};
-use io::{IoContext, IoHandler, TimerToken};
use number_prefix::{binary_prefix, Prefixed, Standalone};
use parity_rpc::{informant::RpcStats, is_major_importing_or_waiting};
use parking_lot::{Mutex, RwLock};
-use sync::{ManageNetwork, SyncProvider};
-use types::BlockNumber;
/// Format byte counts to standard denominations.
pub fn format_bytes(b: usize) -> String {
diff --git a/bin/oe/lib.rs b/bin/oe/lib.rs
index ed9a7166e..4c7a596b1 100644
--- a/bin/oe/lib.rs
+++ b/bin/oe/lib.rs
@@ -114,9 +114,11 @@ mod user_defaults;
use std::{fs::File, io::BufReader, sync::Arc};
-use cli::Args;
-use configuration::{Cmd, Execute};
-use hash::keccak_buffer;
+use crate::{
+ cli::Args,
+ configuration::{Cmd, Execute},
+ hash::keccak_buffer,
+};
#[cfg(feature = "memory_profiling")]
use std::alloc::System;
diff --git a/bin/oe/modules.rs b/bin/oe/modules.rs
index 5cf6971d6..8e8063521 100644
--- a/bin/oe/modules.rs
+++ b/bin/oe/modules.rs
@@ -16,14 +16,16 @@
use std::sync::{mpsc, Arc};
+use crate::{
+ sync::{self, ConnectionFilter, NetworkConfiguration, Params, SyncConfig},
+ types::BlockNumber,
+};
use ethcore::{client::BlockChainClient, snapshot::SnapshotService};
use std::collections::BTreeSet;
-use sync::{self, ConnectionFilter, NetworkConfiguration, Params, SyncConfig};
-use types::BlockNumber;
+pub use crate::sync::{EthSync, ManageNetwork, SyncProvider};
pub use ethcore::client::ChainNotify;
use ethcore_logger::Config as LogConfig;
-pub use sync::{EthSync, ManageNetwork, SyncProvider};
pub type SyncModules = (
Arc,
diff --git a/bin/oe/params.rs b/bin/oe/params.rs
index b1be1cafb..af2747ab1 100644
--- a/bin/oe/params.rs
+++ b/bin/oe/params.rs
@@ -16,6 +16,13 @@
use std::{collections::HashSet, fmt, fs, num::NonZeroU32, str, time::Duration};
+use crate::{
+ miner::{
+ gas_price_calibrator::{GasPriceCalibrator, GasPriceCalibratorOptions},
+ gas_pricer::GasPricer,
+ },
+ user_defaults::UserDefaults,
+};
use ethcore::{
client::Mode,
ethereum,
@@ -24,13 +31,8 @@ use ethcore::{
use ethereum_types::{Address, U256};
use fetch::Client as FetchClient;
use journaldb::Algorithm;
-use miner::{
- gas_price_calibrator::{GasPriceCalibrator, GasPriceCalibratorOptions},
- gas_pricer::GasPricer,
-};
use parity_runtime::Executor;
use parity_version::version_data;
-use user_defaults::UserDefaults;
use crate::configuration;
@@ -374,8 +376,8 @@ pub fn mode_switch_to_bool(
#[cfg(test)]
mod tests {
use super::{tracing_switch_to_bool, Pruning, ResealPolicy, SpecType, Switch};
+ use crate::user_defaults::UserDefaults;
use journaldb::Algorithm;
- use user_defaults::UserDefaults;
#[test]
fn test_spec_type_parsing() {
diff --git a/bin/oe/presale.rs b/bin/oe/presale.rs
index 5a5fecf0c..c44c9fd1c 100644
--- a/bin/oe/presale.rs
+++ b/bin/oe/presale.rs
@@ -14,11 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with OpenEthereum. If not, see .
+use crate::{
+ helpers::{password_from_file, password_prompt},
+ params::SpecType,
+};
use crypto::publickey;
+
use ethkey::Password;
use ethstore::PresaleWallet;
-use helpers::{password_from_file, password_prompt};
-use params::SpecType;
use std::num::NonZeroU32;
#[derive(Debug, PartialEq)]
@@ -45,6 +48,7 @@ pub fn execute(cmd: ImportWallet) -> Result {
}
#[cfg(feature = "accounts")]
+
pub fn import_account(cmd: &ImportWallet, kp: publickey::KeyPair, password: Password) {
use accounts::{AccountProvider, AccountProviderSettings};
use ethstore::{accounts_dir::RootDiskDirectory, EthStore};
diff --git a/bin/oe/rpc.rs b/bin/oe/rpc.rs
index 4cd639ba6..3d90b812e 100644
--- a/bin/oe/rpc.rs
+++ b/bin/oe/rpc.rs
@@ -16,8 +16,11 @@
use std::{collections::HashSet, io, path::PathBuf, sync::Arc};
+use crate::{
+ helpers::parity_ipc_path,
+ rpc_apis::{self, ApiSet},
+};
use dir::{default_data_path, helpers::replace_home};
-use helpers::parity_ipc_path;
use jsonrpc_core::MetaIoHandler;
use parity_rpc::{
self as rpc,
@@ -25,7 +28,6 @@ use parity_rpc::{
DomainsValidation, Metadata,
};
use parity_runtime::Executor;
-use rpc_apis::{self, ApiSet};
pub use parity_rpc::{HttpServer, IpcServer, RequestMiddleware};
//pub use parity_rpc::ws::Server as WsServer;
@@ -182,7 +184,7 @@ pub fn new_ws(
let signer_path;
let path = match conf.support_token_api {
true => {
- signer_path = ::signer::codes_path(&conf.signer_path);
+ signer_path = crate::signer::codes_path(&conf.signer_path);
Some(signer_path.as_path())
}
false => None,
diff --git a/bin/oe/rpc_apis.rs b/bin/oe/rpc_apis.rs
index 0acb88646..50db479cb 100644
--- a/bin/oe/rpc_apis.rs
+++ b/bin/oe/rpc_apis.rs
@@ -23,12 +23,15 @@ use std::{
pub use parity_rpc::signer::SignerService;
-use account_utils::{self, AccountProvider};
+use crate::{
+ account_utils::{self, AccountProvider},
+ miner::external::ExternalMiner,
+ sync::{ManageNetwork, SyncProvider},
+};
use ethcore::{client::Client, miner::Miner, snapshot::SnapshotService};
use ethcore_logger::RotatingLogger;
use fetch::Client as FetchClient;
use jsonrpc_core::{self as core, MetaIoHandler};
-use miner::external::ExternalMiner;
use parity_rpc::{
dispatch::FullDispatcher,
informant::{ActivityNotifier, ClientNotifier},
@@ -36,7 +39,6 @@ use parity_rpc::{
};
use parity_runtime::Executor;
use parking_lot::Mutex;
-use sync::{ManageNetwork, SyncProvider};
#[derive(Debug, PartialEq, Clone, Eq, Hash)]
pub enum Api {
diff --git a/bin/oe/run.rs b/bin/oe/run.rs
index 91d274a67..503524c8b 100644
--- a/bin/oe/run.rs
+++ b/bin/oe/run.rs
@@ -22,10 +22,24 @@ use std::{
time::{Duration, Instant},
};
-use account_utils;
+use crate::{
+ account_utils,
+ cache::CacheConfig,
+ db,
+ helpers::{execute_upgrades, passwords_from_files, to_client_config},
+ informant::{FullNodeInformantData, Informant},
+ metrics::{start_prometheus_metrics, MetricsConfiguration},
+ miner::{external::ExternalMiner, work_notify::WorkPoster},
+ modules,
+ params::{
+ fatdb_switch_to_bool, mode_switch_to_bool, tracing_switch_to_bool, AccountsConfig,
+ GasPricerConfig, MinerExtras, Pruning, SpecType, Switch,
+ },
+ rpc, rpc_apis, secretstore, signer,
+ sync::{self, SyncConfig},
+ user_defaults::UserDefaults,
+};
use ansi_term::Colour;
-use cache::CacheConfig;
-use db;
use dir::{DatabaseDirectories, Directories};
use ethcore::{
client::{BlockChainClient, BlockInfo, Client, DatabaseCompactionProfile, Mode, VMType},
@@ -36,30 +50,15 @@ use ethcore::{
use ethcore_logger::{Config as LogConfig, RotatingLogger};
use ethcore_service::ClientService;
use ethereum_types::{H256, U64};
-use helpers::{execute_upgrades, passwords_from_files, to_client_config};
-use informant::{FullNodeInformantData, Informant};
use journaldb::Algorithm;
use jsonrpc_core;
-use metrics::{start_prometheus_metrics, MetricsConfiguration};
-use miner::{external::ExternalMiner, work_notify::WorkPoster};
-use modules;
use node_filter::NodeFilter;
-use params::{
- fatdb_switch_to_bool, mode_switch_to_bool, tracing_switch_to_bool, AccountsConfig,
- GasPricerConfig, MinerExtras, Pruning, SpecType, Switch,
-};
use parity_rpc::{
informant, is_major_importing, FutureOutput, FutureResponse, FutureResult, Metadata,
NetworkSettings, Origin, PubSubSession,
};
use parity_runtime::Runtime;
use parity_version::version;
-use rpc;
-use rpc_apis;
-use secretstore;
-use signer;
-use sync::{self, SyncConfig};
-use user_defaults::UserDefaults;
// How often we attempt to take a snapshot: only snapshot on blocknumbers that are multiples of this.
const SNAPSHOT_PERIOD: u64 = 20000;
@@ -120,8 +119,8 @@ struct FullNodeInfo {
miner: Option>, // TODO: only TXQ needed, just use that after decoupling.
}
-impl ::local_store::NodeInfo for FullNodeInfo {
- fn pending_transactions(&self) -> Vec<::types::transaction::PendingTransaction> {
+impl crate::local_store::NodeInfo for FullNodeInfo {
+ fn pending_transactions(&self) -> Vec {
let miner = match self.miner.as_ref() {
Some(m) => m,
None => return Vec::new(),
@@ -131,7 +130,7 @@ impl ::local_store::NodeInfo for FullNodeInfo {
.local_transactions()
.values()
.filter_map(|status| match *status {
- ::miner::pool::local_transactions::Status::Pending(ref tx) => {
+ crate::miner::pool::local_transactions::Status::Pending(ref tx) => {
Some(tx.pending().clone())
}
_ => None,
@@ -387,7 +386,7 @@ pub fn execute(cmd: RunCmd, logger: Arc) -> Result) -> Result.
-use account_utils::AccountProvider;
+use crate::{account_utils::AccountProvider, sync::SyncProvider};
use crypto::publickey::{Public, Secret};
use dir::{default_data_path, helpers::replace_home};
use ethcore::{client::Client, miner::Miner};
@@ -22,7 +22,6 @@ use ethereum_types::Address;
use ethkey::Password;
use parity_runtime::Executor;
use std::{collections::BTreeMap, sync::Arc};
-use sync::SyncProvider;
/// This node secret key.
#[derive(Debug, PartialEq, Clone)]
diff --git a/bin/oe/signer.rs b/bin/oe/signer.rs
index 7dd00f728..ff30c11f2 100644
--- a/bin/oe/signer.rs
+++ b/bin/oe/signer.rs
@@ -19,12 +19,10 @@ use std::{
path::{Path, PathBuf},
};
+use crate::{path::restrict_permissions_owner, rpc, rpc_apis};
use ansi_term::Colour::White;
use ethcore_logger::Config as LogConfig;
use parity_rpc;
-use path::restrict_permissions_owner;
-use rpc;
-use rpc_apis;
pub const CODES_FILENAME: &'static str = "authcodes";
diff --git a/bin/oe/snapshot.rs b/bin/oe/snapshot.rs
index 1cd4bbf99..3ed7f0f24 100644
--- a/bin/oe/snapshot.rs
+++ b/bin/oe/snapshot.rs
@@ -22,6 +22,7 @@ use std::{
time::Duration,
};
+use crate::{hash::keccak, types::ids::BlockId};
use ethcore::{
client::{DatabaseCompactionProfile, Mode, VMType},
miner::Miner,
@@ -32,15 +33,15 @@ use ethcore::{
},
};
use ethcore_service::ClientService;
-use hash::keccak;
-use types::ids::BlockId;
-use cache::CacheConfig;
-use db;
+use crate::{
+ cache::CacheConfig,
+ db,
+ helpers::{execute_upgrades, to_client_config},
+ params::{fatdb_switch_to_bool, tracing_switch_to_bool, Pruning, SpecType, Switch},
+ user_defaults::UserDefaults,
+};
use dir::Directories;
-use helpers::{execute_upgrades, to_client_config};
-use params::{fatdb_switch_to_bool, tracing_switch_to_bool, Pruning, SpecType, Switch};
-use user_defaults::UserDefaults;
/// Kinds of snapshot commands.
#[derive(Debug, PartialEq, Clone, Copy)]
@@ -303,7 +304,7 @@ impl SnapshotCommand {
let cur_size = p.size();
if cur_size != last_size {
last_size = cur_size;
- let bytes = ::informant::format_bytes(cur_size as usize);
+ let bytes = crate::informant::format_bytes(cur_size as usize);
info!(
"Snapshot: {} accounts {} blocks {}",
p.accounts(),
diff --git a/crates/ethcore/types/Cargo.toml b/crates/ethcore/types/Cargo.toml
index 86c0d48ea..e0c059a3e 100644
--- a/crates/ethcore/types/Cargo.toml
+++ b/crates/ethcore/types/Cargo.toml
@@ -2,9 +2,14 @@
description = "Parity Ethereum Common Types"
name = "common-types"
version = "0.1.0"
-authors = ["Parity Technologies "]
+edition = "2018"
+authors = [
+ "Gnosis Ltd ",
+ "Parity Technologies ",
+]
[dependencies]
+ethkey = { path = "../../accounts/ethkey" }
ethereum-types = "0.9.2"
keccak-hash = "0.5.0"
parity-bytes = "0.1"
@@ -16,6 +21,8 @@ unexpected = { path = "../../util/unexpected" }
serde = "1.0"
serde_json = "1.0"
serde_repr = "0.1"
+hex = "0.4.3"
+inflate = "0.4.5"
[dev-dependencies]
rustc-hex = "1.0"
diff --git a/crates/ethcore/types/src/account_diff.rs b/crates/ethcore/types/src/account_diff.rs
index 7ea690df1..92a12902e 100644
--- a/crates/ethcore/types/src/account_diff.rs
+++ b/crates/ethcore/types/src/account_diff.rs
@@ -16,7 +16,7 @@
//! Diff between two accounts.
-use bytes::Bytes;
+use crate::bytes::Bytes;
use ethereum_types::{H256, U256};
use std::{cmp::*, collections::BTreeMap, fmt};
@@ -141,7 +141,7 @@ fn interpreted_hash(u: &H256) -> String {
impl fmt::Display for AccountDiff {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- use bytes::ToPretty;
+ use crate::bytes::ToPretty;
match self.nonce {
Diff::Born(ref x) => write!(f, " non {}", x)?,
diff --git a/crates/ethcore/types/src/block.rs b/crates/ethcore/types/src/block.rs
index 221d4d64e..d0c1cc3e8 100644
--- a/crates/ethcore/types/src/block.rs
+++ b/crates/ethcore/types/src/block.rs
@@ -31,11 +31,13 @@
//! `ExecutedBlock` is an underlaying data structure used by all structs above to store block
//! related info.
-use bytes::Bytes;
+use crate::bytes::Bytes;
-use header::Header;
+use crate::{
+ header::Header,
+ transaction::{TypedTransaction, UnverifiedTransaction},
+};
use rlp::{Decodable, DecoderError, Rlp, RlpStream};
-use transaction::{TypedTransaction, UnverifiedTransaction};
/// A block, encoded as it is on the block chain.
#[derive(Default, Debug, Clone, PartialEq)]
diff --git a/crates/ethcore/types/src/blockchain_info.rs b/crates/ethcore/types/src/blockchain_info.rs
index b04a8640d..008fb5a55 100644
--- a/crates/ethcore/types/src/blockchain_info.rs
+++ b/crates/ethcore/types/src/blockchain_info.rs
@@ -18,9 +18,8 @@
use std::fmt;
+use crate::{security_level::SecurityLevel, BlockNumber};
use ethereum_types::{H256, U256};
-use security_level::SecurityLevel;
-use BlockNumber;
/// Information about the blockchain gathered together.
#[derive(Clone, Debug)]
diff --git a/crates/ethcore/types/src/encoded.rs b/crates/ethcore/types/src/encoded.rs
index f55074022..7bad7945e 100644
--- a/crates/ethcore/types/src/encoded.rs
+++ b/crates/ethcore/types/src/encoded.rs
@@ -23,15 +23,18 @@
//! When the entirety of the object is needed, it's better to upgrade it to a fully
//! decoded object where parts like the hash can be saved.
-use block::Block as FullBlock;
+use crate::{
+ block::Block as FullBlock,
+ hash::keccak,
+ header::Header as FullHeader,
+ transaction::UnverifiedTransaction,
+ views::{self, BlockView, BodyView, HeaderView},
+ BlockNumber,
+};
+
use ethereum_types::{Address, Bloom, H256, U256};
-use hash::keccak;
-use header::Header as FullHeader;
use parity_util_mem::MallocSizeOf;
use rlp::{self, Rlp, RlpStream};
-use transaction::UnverifiedTransaction;
-use views::{self, BlockView, BodyView, HeaderView};
-use BlockNumber;
/// Owning header view.
#[derive(Debug, Clone, PartialEq, Eq, MallocSizeOf)]
diff --git a/crates/ethcore/types/src/filter.rs b/crates/ethcore/types/src/filter.rs
index 822c2f7de..5415b447f 100644
--- a/crates/ethcore/types/src/filter.rs
+++ b/crates/ethcore/types/src/filter.rs
@@ -16,9 +16,8 @@
//! Blockchain filter
+use crate::{ids::BlockId, log_entry::LogEntry};
use ethereum_types::{Address, Bloom, BloomInput, H256};
-use ids::BlockId;
-use log_entry::LogEntry;
/// Blockchain Filter.
#[derive(Debug, PartialEq)]
@@ -119,10 +118,8 @@ impl Filter {
#[cfg(test)]
mod tests {
+ use crate::{filter::Filter, ids::BlockId, log_entry::LogEntry};
use ethereum_types::{Bloom, H160, H256};
- use filter::Filter;
- use ids::BlockId;
- use log_entry::LogEntry;
use std::str::FromStr;
#[test]
diff --git a/crates/ethcore/types/src/header.rs b/crates/ethcore/types/src/header.rs
index 88c68e835..a5f9b988e 100644
--- a/crates/ethcore/types/src/header.rs
+++ b/crates/ethcore/types/src/header.rs
@@ -16,12 +16,14 @@
//! Block header.
-use bytes::Bytes;
+use crate::{
+ bytes::Bytes,
+ hash::{keccak, KECCAK_EMPTY_LIST_RLP, KECCAK_NULL_RLP},
+ BlockNumber,
+};
use ethereum_types::{Address, Bloom, H256, U256};
-use hash::{keccak, KECCAK_EMPTY_LIST_RLP, KECCAK_NULL_RLP};
use parity_util_mem::MallocSizeOf;
use rlp::{Decodable, DecoderError, Encodable, Rlp, RlpStream};
-use BlockNumber;
/// Semantic boolean for when a seal/signature is included.
#[derive(Debug, Clone, Copy)]
@@ -307,8 +309,8 @@ impl Header {
}
/// Encode the header, getting a type-safe wrapper around the RLP.
- pub fn encoded(&self) -> ::encoded::Header {
- ::encoded::Header::new(self.rlp(Seal::With))
+ pub fn encoded(&self) -> crate::encoded::Header {
+ crate::encoded::Header::new(self.rlp(Seal::With))
}
/// Get the RLP representation of this Header.
diff --git a/crates/ethcore/types/src/ids.rs b/crates/ethcore/types/src/ids.rs
index c117ed3c1..7be363d1d 100644
--- a/crates/ethcore/types/src/ids.rs
+++ b/crates/ethcore/types/src/ids.rs
@@ -16,8 +16,8 @@
//! Unique identifiers.
+use crate::BlockNumber;
use ethereum_types::H256;
-use BlockNumber;
/// Uniquely identifies block.
#[derive(Debug, PartialEq, Copy, Clone, Hash, Eq)]
diff --git a/crates/ethcore/types/src/lib.rs b/crates/ethcore/types/src/lib.rs
index 2eafc66ee..73e934284 100644
--- a/crates/ethcore/types/src/lib.rs
+++ b/crates/ethcore/types/src/lib.rs
@@ -34,20 +34,15 @@
#![allow(missing_docs)]
#![warn(unused_extern_crates)]
-extern crate ethereum_types;
-extern crate keccak_hash as hash;
-extern crate parity_bytes as bytes;
-extern crate parity_crypto as crypto;
-extern crate parity_util_mem;
-extern crate rlp;
-extern crate serde_repr;
-extern crate unexpected;
+pub use keccak_hash as hash;
+pub use parity_bytes as bytes;
+pub use parity_crypto as crypto;
#[macro_use]
extern crate rlp_derive;
#[cfg(test)]
-extern crate rustc_hex;
+pub use rustc_hex;
#[macro_use]
pub mod views;
diff --git a/crates/ethcore/types/src/log_entry.rs b/crates/ethcore/types/src/log_entry.rs
index 8c72df15b..f607ce8b3 100644
--- a/crates/ethcore/types/src/log_entry.rs
+++ b/crates/ethcore/types/src/log_entry.rs
@@ -16,13 +16,11 @@
//! Log entry type definition.
-use bytes::Bytes;
+use crate::{bytes::Bytes, BlockNumber};
use ethereum_types::{Address, Bloom, BloomInput, H256};
use parity_util_mem::MallocSizeOf;
use std::ops::Deref;
-use BlockNumber;
-
/// A record of execution for a `LOG` operation.
#[derive(Default, Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable, MallocSizeOf)]
pub struct LogEntry {
diff --git a/crates/ethcore/types/src/receipt.rs b/crates/ethcore/types/src/receipt.rs
index 2026081a8..1ae47bc16 100644
--- a/crates/ethcore/types/src/receipt.rs
+++ b/crates/ethcore/types/src/receipt.rs
@@ -22,8 +22,10 @@ use parity_util_mem::MallocSizeOf;
use rlp::{DecoderError, Rlp, RlpStream};
use std::ops::{Deref, DerefMut};
-use log_entry::{LocalizedLogEntry, LogEntry};
-use BlockNumber;
+use crate::{
+ log_entry::{LocalizedLogEntry, LogEntry},
+ BlockNumber,
+};
/// Transaction outcome store in the receipt.
#[derive(Debug, Clone, PartialEq, Eq, MallocSizeOf)]
@@ -296,8 +298,8 @@ pub struct LocalizedReceipt {
#[cfg(test)]
mod tests {
use super::{LegacyReceipt, TransactionOutcome, TypedReceipt, TypedTxId};
+ use crate::log_entry::LogEntry;
use ethereum_types::{H160, H256};
- use log_entry::LogEntry;
use std::str::FromStr;
#[test]
diff --git a/crates/ethcore/types/src/security_level.rs b/crates/ethcore/types/src/security_level.rs
index 10439ff02..c49bbe40c 100644
--- a/crates/ethcore/types/src/security_level.rs
+++ b/crates/ethcore/types/src/security_level.rs
@@ -16,7 +16,7 @@
//! Indication of how secure the chain is.
-use BlockNumber;
+use crate::BlockNumber;
/// Indication of how secure the chain is.
#[derive(Debug, PartialEq, Copy, Clone, Hash, Eq)]
diff --git a/crates/ethcore/types/src/snapshot_manifest.rs b/crates/ethcore/types/src/snapshot_manifest.rs
index 461e2a5bb..e5220e0eb 100644
--- a/crates/ethcore/types/src/snapshot_manifest.rs
+++ b/crates/ethcore/types/src/snapshot_manifest.rs
@@ -16,7 +16,7 @@
//! Snapshot manifest type definition
-use bytes::Bytes;
+use crate::bytes::Bytes;
use ethereum_types::H256;
use rlp::{DecoderError, Rlp, RlpStream};
diff --git a/crates/ethcore/types/src/state_diff.rs b/crates/ethcore/types/src/state_diff.rs
index 439133c83..0045796c6 100644
--- a/crates/ethcore/types/src/state_diff.rs
+++ b/crates/ethcore/types/src/state_diff.rs
@@ -16,7 +16,7 @@
//! State diff module.
-use account_diff::*;
+use crate::account_diff::*;
use ethereum_types::Address;
use std::{collections::BTreeMap, fmt, ops::*};
diff --git a/crates/ethcore/types/src/trace_filter.rs b/crates/ethcore/types/src/trace_filter.rs
index 5404bad95..66104acb4 100644
--- a/crates/ethcore/types/src/trace_filter.rs
+++ b/crates/ethcore/types/src/trace_filter.rs
@@ -16,8 +16,8 @@
//! Trace filter related types
+use crate::ids::BlockId;
use ethereum_types::Address;
-use ids::BlockId;
use std::ops::Range;
/// Easy to use trace filter.
diff --git a/crates/ethcore/types/src/transaction/error.rs b/crates/ethcore/types/src/transaction/error.rs
index aa927c55e..d3351cad8 100644
--- a/crates/ethcore/types/src/transaction/error.rs
+++ b/crates/ethcore/types/src/transaction/error.rs
@@ -16,6 +16,7 @@
use std::{error, fmt};
+use crate::crypto;
use ethereum_types::U256;
use rlp;
use unexpected::OutOfBounds;
diff --git a/crates/ethcore/types/src/transaction/transaction.rs b/crates/ethcore/types/src/transaction/transaction.rs
index 55a10506d..892b00ea0 100644
--- a/crates/ethcore/types/src/transaction/transaction.rs
+++ b/crates/ethcore/types/src/transaction/transaction.rs
@@ -16,10 +16,14 @@
//! Transaction data structure.
-use crypto::publickey::{self, public_to_address, recover, Public, Secret, Signature};
+use crate::{
+ crypto::publickey::{self, public_to_address, recover, Public, Secret, Signature},
+ hash::keccak,
+ transaction::error,
+};
use ethereum_types::{Address, BigEndianHash, H160, H256, U256};
-use hash::keccak;
use parity_util_mem::MallocSizeOf;
+
use rlp::{self, DecoderError, Rlp, RlpStream};
use std::ops::Deref;
@@ -28,8 +32,6 @@ pub type AccessList = Vec;
use super::TypedTxId;
-use transaction::error;
-
type Bytes = Vec;
type BlockNumber = u64;
@@ -134,7 +136,7 @@ pub struct Transaction {
pub gas: U256,
/// Action, can be either call or contract create.
pub action: Action,
- /// Transfered value.
+ /// Transfered value.s
pub value: U256,
/// Transaction data.
pub data: Bytes,
@@ -430,7 +432,6 @@ impl TypedTransaction {
/// Legacy EIP-86 compatible empty signature.
/// This method is used in json tests as well as
/// signature verification tests.
- #[cfg(any(test, feature = "test-helpers"))]
pub fn null_sign(self, chain_id: u64) -> SignedTransaction {
SignedTransaction {
transaction: UnverifiedTransaction {
@@ -566,11 +567,11 @@ impl TypedTransaction {
pub struct SignatureComponents {
/// The V field of the signature; the LS bit described which half of the curve our point falls
/// in. It can be 0 or 1.
- standard_v: u8,
+ pub standard_v: u8,
/// The R field of the signature; helps describe the point on the curve.
- r: U256,
+ pub r: U256,
/// The S field of the signature; helps describe the point on the curve.
- s: U256,
+ pub s: U256,
}
impl SignatureComponents {
@@ -594,13 +595,13 @@ impl SignatureComponents {
#[derive(Debug, Clone, Eq, PartialEq, MallocSizeOf)]
pub struct UnverifiedTransaction {
/// Plain Transaction.
- unsigned: TypedTransaction,
+ pub unsigned: TypedTransaction,
/// Transaction signature
- signature: SignatureComponents,
+ pub signature: SignatureComponents,
/// chain_id recover from signature in legacy transaction. For TypedTransaction it is probably separate field.
- chain_id: Option,
+ pub chain_id: Option,
/// Hash of the transaction
- hash: H256,
+ pub hash: H256,
}
impl Deref for UnverifiedTransaction {
@@ -628,7 +629,7 @@ impl UnverifiedTransaction {
}
/// Used to compute hash of created transactions.
- fn compute_hash(mut self) -> UnverifiedTransaction {
+ pub fn compute_hash(mut self) -> UnverifiedTransaction {
let hash = keccak(&*self.encode());
self.hash = hash;
self
@@ -874,8 +875,8 @@ impl From for PendingTransaction {
#[cfg(test)]
mod tests {
use super::*;
+ use crate::hash::keccak;
use ethereum_types::{H160, U256};
- use hash::keccak;
use std::str::FromStr;
#[test]
diff --git a/crates/ethcore/types/src/views/block.rs b/crates/ethcore/types/src/views/block.rs
index 1d7fbf345..06edfe9ea 100644
--- a/crates/ethcore/types/src/views/block.rs
+++ b/crates/ethcore/types/src/views/block.rs
@@ -17,12 +17,15 @@
//! View onto block rlp.
use super::ViewRlp;
-use bytes::Bytes;
+use crate::{
+ bytes::Bytes,
+ hash::keccak,
+ header::Header,
+ transaction::{LocalizedTransaction, TypedTransaction, UnverifiedTransaction},
+ views::{HeaderView, TypedTransactionView},
+};
+
use ethereum_types::H256;
-use hash::keccak;
-use header::Header;
-use transaction::{LocalizedTransaction, TypedTransaction, UnverifiedTransaction};
-use views::{HeaderView, TypedTransactionView};
/// View onto block rlp.
pub struct BlockView<'a> {
diff --git a/crates/ethcore/types/src/views/body.rs b/crates/ethcore/types/src/views/body.rs
index 3bdf7f274..218e79185 100644
--- a/crates/ethcore/types/src/views/body.rs
+++ b/crates/ethcore/types/src/views/body.rs
@@ -17,13 +17,15 @@
//! View onto block body rlp.
use super::ViewRlp;
-use bytes::Bytes;
+use crate::{
+ bytes::Bytes,
+ hash::keccak,
+ header::Header,
+ transaction::{LocalizedTransaction, TypedTransaction, UnverifiedTransaction},
+ views::{HeaderView, TypedTransactionView},
+ BlockNumber,
+};
use ethereum_types::H256;
-use hash::keccak;
-use header::Header;
-use transaction::{LocalizedTransaction, TypedTransaction, UnverifiedTransaction};
-use views::{HeaderView, TypedTransactionView};
-use BlockNumber;
/// View onto block rlp.
pub struct BodyView<'a> {
@@ -184,10 +186,9 @@ impl<'a> BodyView<'a> {
#[cfg(test)]
mod tests {
use super::BodyView;
- use bytes::Bytes;
+ use crate::{bytes::Bytes, views::BlockView};
use rlp::RlpStream;
use rustc_hex::FromHex;
- use views::BlockView;
fn block_to_body(block: &[u8]) -> Bytes {
let mut body = RlpStream::new_list(2);
diff --git a/crates/ethcore/types/src/views/header.rs b/crates/ethcore/types/src/views/header.rs
index a5ecd8e2e..db33b2eb6 100644
--- a/crates/ethcore/types/src/views/header.rs
+++ b/crates/ethcore/types/src/views/header.rs
@@ -17,11 +17,9 @@
//! View onto block header rlp
use super::ViewRlp;
-use bytes::Bytes;
+use crate::{bytes::Bytes, hash::keccak, BlockNumber};
use ethereum_types::{Address, Bloom, H256, U256};
-use hash::keccak;
use rlp::{self};
-use BlockNumber;
/// View onto block header rlp.
pub struct HeaderView<'a> {
diff --git a/crates/ethcore/types/src/views/typed_transaction.rs b/crates/ethcore/types/src/views/typed_transaction.rs
index e9a9da115..39b670c65 100644
--- a/crates/ethcore/types/src/views/typed_transaction.rs
+++ b/crates/ethcore/types/src/views/typed_transaction.rs
@@ -16,12 +16,14 @@
//! View onto transaction rlp
-use crate::transaction::{signature, TypedTxId};
+use crate::{
+ bytes::Bytes,
+ hash::keccak,
+ transaction::{signature, TypedTxId},
+ views::ViewRlp,
+};
-use super::ViewRlp;
-use bytes::Bytes;
use ethereum_types::{H256, U256};
-use hash::keccak;
use rlp::Rlp;
/// View onto transaction rlp. Assumption is this is part of block.
diff --git a/crates/ethjson/Cargo.toml b/crates/ethjson/Cargo.toml
index 819db5dbf..436bfef02 100644
--- a/crates/ethjson/Cargo.toml
+++ b/crates/ethjson/Cargo.toml
@@ -2,7 +2,11 @@
description = "Parity Ethereum JSON Deserialization"
name = "ethjson"
version = "0.1.0"
-authors = ["Parity Technologies "]
+edition = "2018"
+authors = [
+ "Gnosis Ltd ",
+ "Parity Technologies "
+ ]
[dependencies]
common-types = { path = "../ethcore/types", features = ["test-helpers"] }
diff --git a/crates/ethjson/src/blockchain/account.rs b/crates/ethjson/src/blockchain/account.rs
index fc39b074e..678db5d10 100644
--- a/crates/ethjson/src/blockchain/account.rs
+++ b/crates/ethjson/src/blockchain/account.rs
@@ -16,9 +16,8 @@
//! Blockchain test account deserializer.
-use bytes::Bytes;
+use crate::{bytes::Bytes, uint::Uint};
use std::collections::BTreeMap;
-use uint::Uint;
/// Blockchain test account deserializer.
#[derive(Debug, PartialEq, Deserialize, Clone)]
@@ -35,7 +34,7 @@ pub struct Account {
#[cfg(test)]
mod tests {
- use blockchain::account::Account;
+ use crate::blockchain::account::Account;
use serde_json;
#[test]
diff --git a/crates/ethjson/src/blockchain/block.rs b/crates/ethjson/src/blockchain/block.rs
index 045a42f33..2c6fa3839 100644
--- a/crates/ethjson/src/blockchain/block.rs
+++ b/crates/ethjson/src/blockchain/block.rs
@@ -16,8 +16,10 @@
//! Blockchain test block deserializer.
-use blockchain::{header::Header, transaction::Transaction};
-use bytes::Bytes;
+use crate::{
+ blockchain::{header::Header, transaction::Transaction},
+ bytes::Bytes,
+};
/// Blockchain test block deserializer.
#[derive(Debug, PartialEq, Deserialize)]
@@ -39,7 +41,7 @@ impl Block {
#[cfg(test)]
mod tests {
- use blockchain::block::Block;
+ use crate::blockchain::block::Block;
use serde_json;
#[test]
diff --git a/crates/ethjson/src/blockchain/blockchain.rs b/crates/ethjson/src/blockchain/blockchain.rs
index 7e1406f0a..3f7e5b061 100644
--- a/crates/ethjson/src/blockchain/blockchain.rs
+++ b/crates/ethjson/src/blockchain/blockchain.rs
@@ -16,10 +16,12 @@
//! Blockchain deserialization.
-use blockchain::{block::Block, header::Header, state::State};
-use bytes::Bytes;
-use hash::H256;
-use spec::{Ethereum, ForkSpec, Genesis, Seal};
+use crate::{
+ blockchain::{block::Block, header::Header, state::State},
+ bytes::Bytes,
+ hash::H256,
+ spec::{Ethereum, ForkSpec, Genesis, Seal},
+};
/// Json Block test possible engine kind.
#[derive(Debug, PartialEq, Deserialize)]
@@ -93,7 +95,7 @@ impl BlockChain {
#[cfg(test)]
mod tests {
- use blockchain::blockchain::BlockChain;
+ use crate::blockchain::blockchain::BlockChain;
use serde_json;
#[test]
diff --git a/crates/ethjson/src/blockchain/header.rs b/crates/ethjson/src/blockchain/header.rs
index 8fcb25caa..f03cb7dcf 100644
--- a/crates/ethjson/src/blockchain/header.rs
+++ b/crates/ethjson/src/blockchain/header.rs
@@ -16,9 +16,11 @@
//! Blockchain test header deserializer.
-use bytes::Bytes;
-use hash::{Address, Bloom, H256, H64};
-use uint::Uint;
+use crate::{
+ bytes::Bytes,
+ hash::{Address, Bloom, H256, H64},
+ uint::Uint,
+};
/// Blockchain test header deserializer.
#[derive(Debug, PartialEq, Deserialize)]
@@ -64,7 +66,7 @@ pub struct Header {
#[cfg(test)]
mod tests {
- use blockchain::header::Header;
+ use crate::blockchain::header::Header;
use serde_json;
#[test]
diff --git a/crates/ethjson/src/blockchain/test.rs b/crates/ethjson/src/blockchain/test.rs
index 01ace8eb6..3eb8bed76 100644
--- a/crates/ethjson/src/blockchain/test.rs
+++ b/crates/ethjson/src/blockchain/test.rs
@@ -16,7 +16,7 @@
//! Blockchain test deserializer.
-use blockchain::blockchain::BlockChain;
+use crate::blockchain::blockchain::BlockChain;
use serde_json::{self, Error};
use std::{collections::BTreeMap, io::Read};
diff --git a/crates/ethjson/src/blockchain/transaction.rs b/crates/ethjson/src/blockchain/transaction.rs
index 277e52001..dc470a29d 100644
--- a/crates/ethjson/src/blockchain/transaction.rs
+++ b/crates/ethjson/src/blockchain/transaction.rs
@@ -16,9 +16,8 @@
//! Blockchain test transaction deserialization.
-use bytes::Bytes;
+use crate::{bytes::Bytes, uint::Uint};
use ethereum_types::{H160, H256};
-use uint::Uint;
/// Blockchain test transaction deserialization.
#[derive(Debug, PartialEq, Deserialize)]
@@ -39,11 +38,11 @@ pub struct Transaction {
pub hash: Option,
}
-pub type AccessList = Vec;
-
#[derive(Debug, PartialEq, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct AccessListItem {
pub address: H160,
pub storage_keys: Vec,
}
+
+pub type AccessList = Vec;
diff --git a/crates/ethjson/src/bytes.rs b/crates/ethjson/src/bytes.rs
index bc9804f5d..8fd7852ac 100644
--- a/crates/ethjson/src/bytes.rs
+++ b/crates/ethjson/src/bytes.rs
@@ -102,7 +102,7 @@ impl<'a> Visitor<'a> for BytesVisitor {
#[cfg(test)]
mod test {
- use bytes::Bytes;
+ use crate::bytes::Bytes;
use serde_json;
#[test]
diff --git a/crates/ethjson/src/hash.rs b/crates/ethjson/src/hash.rs
index c0b7d834b..bc59c966b 100644
--- a/crates/ethjson/src/hash.rs
+++ b/crates/ethjson/src/hash.rs
@@ -112,8 +112,8 @@ impl_hash!(Bloom, Hash2048);
#[cfg(test)]
mod test {
+ use crate::hash::H256;
use ethereum_types;
- use hash::H256;
use serde_json;
use std::str::FromStr;
diff --git a/crates/ethjson/src/lib.rs b/crates/ethjson/src/lib.rs
index 910175dfb..851b1dbab 100644
--- a/crates/ethjson/src/lib.rs
+++ b/crates/ethjson/src/lib.rs
@@ -14,9 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with OpenEthereum. If not, see .
-extern crate common_types as types;
-extern crate ethereum_types;
-extern crate parity_crypto as crypto;
+pub use common_types as types;
+pub use parity_crypto as crypto;
+
extern crate rustc_hex;
extern crate serde;
extern crate serde_json;
diff --git a/crates/ethjson/src/local_tests/mod.rs b/crates/ethjson/src/local_tests/mod.rs
index f051528fb..d7b490d75 100644
--- a/crates/ethjson/src/local_tests/mod.rs
+++ b/crates/ethjson/src/local_tests/mod.rs
@@ -1,4 +1,4 @@
-use blockchain::block::Block;
+use crate::blockchain::block::Block;
use serde_json::{self, Error};
use std::{collections::BTreeMap, io::Read};
diff --git a/crates/ethjson/src/maybe.rs b/crates/ethjson/src/maybe.rs
index 4d72a6735..da1116942 100644
--- a/crates/ethjson/src/maybe.rs
+++ b/crates/ethjson/src/maybe.rs
@@ -94,9 +94,8 @@ impl Into