From acad59b3009f87e001dbb6f36837088620964976 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Mon, 16 Sep 2019 21:56:53 +0200 Subject: [PATCH] [sync]: remove unused dependencies or make dev (#11061) --- Cargo.lock | 4 ---- ethcore/sync/Cargo.toml | 9 ++------- ethcore/sync/src/chain/mod.rs | 8 +++++++- ethcore/sync/src/lib.rs | 16 +++++++--------- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 59949f94b..73b2f694a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1464,13 +1464,9 @@ dependencies = [ "ethcore-private-tx 1.0.0", "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.3.0", - "ethstore 0.2.1", "fastmap 0.1.0", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hasher 0.1.1", - "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "machine 0.1.0", diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index 1811387c6..ff2d36ef8 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -10,9 +10,7 @@ authors = ["Parity Technologies "] [dependencies] client-traits = { path = "../client-traits" } common-types = { path = "../types" } -engine = { path = "../engine" } enum_primitive = "0.1.1" -ethcore = { path = ".." } ethcore-io = { path = "../../util/io" } ethcore-light = { path = "../light" } ethcore-network = { path = "../../util/network" } @@ -20,15 +18,10 @@ ethcore-network-devp2p = { path = "../../util/network-devp2p" } ethcore-private-tx = { path = "../private-tx" } ethereum-types = "0.6.0" ethkey = { path = "../../accounts/ethkey" } -ethstore = { path = "../../accounts/ethstore" } fastmap = { path = "../../util/fastmap" } futures = "0.1" -hash-db = "0.15.0" keccak-hash = "0.2.0" -keccak-hasher = { path = "../../util/keccak-hasher" } -kvdb = "0.1" log = "0.4" -machine = { path = "../machine" } macros = { path = "../../util/macros" } parity-bytes = "0.1" parity-runtime = { path = "../../util/runtime" } @@ -42,9 +35,11 @@ triehash-ethereum = { version = "0.2", path = "../../util/triehash-ethereum" } [dev-dependencies] env_logger = "0.5" +engine = { path = "../engine" } ethcore = { path = "..", features = ["test-helpers"] } ethcore-io = { path = "../../util/io", features = ["mio"] } kvdb-memorydb = "0.1" +machine = { path = "../machine" } rand_xorshift = "0.1.1" rustc-hex = "1.0" spec = { path = "../spec" } diff --git a/ethcore/sync/src/chain/mod.rs b/ethcore/sync/src/chain/mod.rs index ed0f86716..9467d0831 100644 --- a/ethcore/sync/src/chain/mod.rs +++ b/ethcore/sync/src/chain/mod.rs @@ -377,11 +377,17 @@ pub mod random { use rand; pub fn new() -> rand::rngs::ThreadRng { rand::thread_rng() } } + #[cfg(test)] pub mod random { use rand::SeedableRng; + use rand_xorshift::XorShiftRng; + const RNG_SEED: [u8; 16] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; - pub fn new() -> rand_xorshift::XorShiftRng { rand_xorshift::XorShiftRng::from_seed(RNG_SEED) } + + pub fn new() -> XorShiftRng { + XorShiftRng::from_seed(RNG_SEED) + } } pub type RlpResponseResult = Result, PacketDecodeError>; diff --git a/ethcore/sync/src/lib.rs b/ethcore/sync/src/lib.rs index 8286de559..61e82ad03 100644 --- a/ethcore/sync/src/lib.rs +++ b/ethcore/sync/src/lib.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity Ethereum. If not, see . -#![warn(missing_docs)] +#![warn(missing_docs, unused_extern_crates)] //! Blockchain sync module //! Implements ethereum protocol version 63 as specified here: @@ -23,7 +23,6 @@ extern crate client_traits; extern crate common_types as types; -extern crate ethcore; extern crate ethcore_io as io; extern crate ethcore_light as light; extern crate ethcore_network as network; @@ -31,7 +30,6 @@ extern crate ethcore_network_devp2p as devp2p; extern crate ethcore_private_tx; extern crate ethereum_types; extern crate ethkey; -extern crate ethstore; extern crate fastmap; extern crate futures; extern crate keccak_hash as hash; @@ -43,12 +41,13 @@ extern crate rlp; extern crate snapshot; extern crate triehash_ethereum; -#[cfg(test)] extern crate env_logger; -#[cfg(test)] extern crate kvdb_memorydb; -#[cfg(test)] extern crate rustc_hex; -#[cfg(test)] extern crate rand_xorshift; -#[cfg(test)] extern crate machine; #[cfg(test)] extern crate engine; +#[cfg(test)] extern crate env_logger; +#[cfg(test)] extern crate ethcore; +#[cfg(test)] extern crate kvdb_memorydb; +#[cfg(test)] extern crate machine; +#[cfg(test)] extern crate rand_xorshift; +#[cfg(test)] extern crate rustc_hex; #[cfg(test)] extern crate spec; #[macro_use] @@ -58,7 +57,6 @@ extern crate macros; #[macro_use] extern crate log; extern crate parity_util_mem; -extern crate parity_util_mem as mem; #[macro_use] extern crate parity_util_mem as malloc_size_of; #[macro_use]