diff --git a/Cargo.lock b/Cargo.lock index e1c089df2..7d77935fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -586,7 +586,6 @@ dependencies = [ "ethcore 1.9.0", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-devtools 1.9.0", "ethcore-io 1.9.0", "ethcore-network 1.9.0", "ethcore-util 1.9.0", @@ -610,6 +609,7 @@ dependencies = [ "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", + "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", "triehash 0.1.0", "vm 0.1.0", @@ -673,7 +673,6 @@ dependencies = [ "ethcore 1.9.0", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-devtools 1.9.0", "ethcore-logger 1.9.0", "ethcore-util 1.9.0", "ethcrypto 0.1.0", @@ -692,6 +691,7 @@ dependencies = [ "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -706,9 +706,7 @@ version = "1.9.0" dependencies = [ "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.2.1", - "ethcore-devtools 1.9.0", "ethcore-logger 1.9.0", - "ethcore-util 1.9.0", "hash 0.1.0", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", @@ -847,7 +845,6 @@ dependencies = [ "ethcore 1.9.0", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-devtools 1.9.0", "ethcore-io 1.9.0", "ethcore-light 1.9.0", "ethcore-network 1.9.0", @@ -2057,7 +2054,6 @@ dependencies = [ "ethcore 1.9.0", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-util 1.9.0", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-http-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "multihash 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2071,7 +2067,6 @@ version = "0.1.0" dependencies = [ "ethcore 1.9.0", "ethcore-io 1.9.0", - "ethcore-util 1.9.0", "ethkey 0.2.0", "kvdb 0.1.0", "kvdb-memorydb 0.1.0", diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index 2b56a30bd..c8b42f4ec 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -16,7 +16,6 @@ memorydb = { path = "../../util/memorydb" } patricia_trie = { path = "../../util/patricia_trie" } ethcore-network = { path = "../../util/network" } ethcore-io = { path = "../../util/io" } -ethcore-devtools = { path = "../../devtools" } evm = { path = "../evm" } heapsize = "0.4" vm = { path = "../vm" } @@ -39,5 +38,8 @@ kvdb-rocksdb = { path = "../../util/kvdb-rocksdb" } kvdb-memorydb = { path = "../../util/kvdb-memorydb" } memory-cache = { path = "../../util/memory_cache" } +[dev-dependencies] +tempdir = "0.3" + [features] default = [] diff --git a/ethcore/light/src/client/service.rs b/ethcore/light/src/client/service.rs index b05c7dacb..b28169c5d 100644 --- a/ethcore/light/src/client/service.rs +++ b/ethcore/light/src/client/service.rs @@ -120,7 +120,6 @@ impl IoHandler for ImportBlocks { #[cfg(test)] mod tests { use super::Service; - use devtools::RandomTempPath; use ethcore::spec::Spec; use std::sync::Arc; @@ -128,13 +127,14 @@ mod tests { use client::fetch; use time::Duration; use parking_lot::Mutex; + use tempdir::TempDir; #[test] fn it_works() { + let tempdir = TempDir::new("").unwrap(); let spec = Spec::new_test(); - let temp_path = RandomTempPath::new(); let cache = Arc::new(Mutex::new(Cache::new(Default::default(), Duration::hours(6)))); - Service::start(Default::default(), &spec, fetch::unavailable(), temp_path.as_path(), cache).unwrap(); + Service::start(Default::default(), &spec, fetch::unavailable(), tempdir.path(), cache).unwrap(); } } diff --git a/ethcore/light/src/lib.rs b/ethcore/light/src/lib.rs index f9c3d89b8..529aed608 100644 --- a/ethcore/light/src/lib.rs +++ b/ethcore/light/src/lib.rs @@ -84,4 +84,4 @@ extern crate kvdb_rocksdb; extern crate memory_cache; #[cfg(test)] -extern crate ethcore_devtools as devtools; +extern crate tempdir; diff --git a/ethcore/light/src/net/load_timer.rs b/ethcore/light/src/net/load_timer.rs index 8df8fdf17..6b522f920 100644 --- a/ethcore/light/src/net/load_timer.rs +++ b/ethcore/light/src/net/load_timer.rs @@ -264,8 +264,9 @@ mod tests { #[test] fn file_store() { - let path = ::devtools::RandomTempPath::new(); - let store = FileStore(path.as_path().clone()); + let tempdir = ::tempdir::TempDir::new("").unwrap(); + let path = tempdir.path().join("file"); + let store = FileStore(path); let mut samples = store.load(); assert!(samples.is_empty()); diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index 0e8b21c15..da3b48eef 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -7,7 +7,6 @@ authors = ["Parity Technologies "] [dependencies] ethcore = { path = "../ethcore" } -ethcore-util = { path = "../util" } ethcore-bigint = { path = "../util/bigint" } ethcore-bytes = { path = "../util/bytes" } jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } diff --git a/ipfs/src/lib.rs b/ipfs/src/lib.rs index ef6184b1b..b92108b52 100644 --- a/ipfs/src/lib.rs +++ b/ipfs/src/lib.rs @@ -20,7 +20,6 @@ extern crate unicase; extern crate rlp; extern crate ethcore; -extern crate ethcore_util as util; extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; extern crate jsonrpc_core as core; diff --git a/local-store/Cargo.toml b/local-store/Cargo.toml index e4b97f7a4..7dd73d464 100644 --- a/local-store/Cargo.toml +++ b/local-store/Cargo.toml @@ -5,7 +5,6 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ethcore-util = { path = "../util" } ethcore-io = { path = "../util/io" } ethcore = { path = "../ethcore" } rlp = { path = "../util/rlp" } diff --git a/local-store/src/lib.rs b/local-store/src/lib.rs index 694fa7aea..ccd2b11b7 100644 --- a/local-store/src/lib.rs +++ b/local-store/src/lib.rs @@ -29,7 +29,6 @@ use rlp::UntrustedRlp; use kvdb::KeyValueDB; extern crate ethcore; -extern crate ethcore_util as util; extern crate ethcore_io as io; extern crate rlp; extern crate serde_json; diff --git a/secret_store/Cargo.toml b/secret_store/Cargo.toml index 8357b530b..432b08c42 100644 --- a/secret_store/Cargo.toml +++ b/secret_store/Cargo.toml @@ -24,7 +24,6 @@ tokio-proto = "0.1" url = "1.0" ethcore = { path = "../ethcore" } ethcore-bytes = { path = "../util/bytes" } -ethcore-devtools = { path = "../devtools" } ethcore-util = { path = "../util" } ethcore-bigint = { path = "../util/bigint" } kvdb = { path = "../util/kvdb" } @@ -35,3 +34,6 @@ ethcrypto = { path = "../ethcrypto" } ethkey = { path = "../ethkey" } native-contracts = { path = "../ethcore/native_contracts" } lazy_static = "0.2" + +[dev-dependencies] +tempdir = "0.3" diff --git a/secret_store/src/key_storage.rs b/secret_store/src/key_storage.rs index eb100f388..fec58de2b 100644 --- a/secret_store/src/key_storage.rs +++ b/secret_store/src/key_storage.rs @@ -366,10 +366,12 @@ impl From for DocumentKeyShare { #[cfg(test)] pub mod tests { + extern crate tempdir; + use std::collections::{BTreeMap, HashMap}; use parking_lot::RwLock; use serde_json; - use devtools::RandomTempPath; + use self::tempdir::TempDir; use ethkey::{Random, Generator, Public, Secret}; use kvdb_rocksdb::Database; use types::all::{Error, NodeAddress, ServiceConfiguration, ClusterConfiguration, ServerKeyId}; @@ -419,11 +421,11 @@ pub mod tests { #[test] fn persistent_key_storage() { - let path = RandomTempPath::create_dir(); + let tempdir = TempDir::new("").unwrap(); let config = ServiceConfiguration { listener_address: None, acl_check_enabled: true, - data_path: path.as_str().to_owned(), + data_path: tempdir.path().display().to_string(), cluster_config: ClusterConfiguration { threads: 1, listener_address: NodeAddress { @@ -482,8 +484,8 @@ pub mod tests { #[test] fn upgrade_db_from_0() { - let db_path = RandomTempPath::create_dir(); - let db = Database::open_default(db_path.as_str()).unwrap(); + let tempdir = TempDir::new("").unwrap(); + let db = Database::open_default(&tempdir.path().display().to_string()).unwrap(); // prepare v0 database { @@ -523,8 +525,8 @@ pub mod tests { #[test] fn upgrade_db_from_1() { - let db_path = RandomTempPath::create_dir(); - let db = Database::open_default(db_path.as_str()).unwrap(); + let tempdir = TempDir::new("").unwrap(); + let db = Database::open_default(&tempdir.path().display().to_string()).unwrap(); // prepare v1 database { diff --git a/secret_store/src/lib.rs b/secret_store/src/lib.rs index 5951be508..9979578c7 100644 --- a/secret_store/src/lib.rs +++ b/secret_store/src/lib.rs @@ -37,7 +37,6 @@ extern crate tokio_proto; extern crate url; extern crate ethcore; -extern crate ethcore_devtools as devtools; extern crate ethcore_bytes as bytes; extern crate ethcore_util as util; extern crate ethcore_bigint as bigint; diff --git a/stratum/Cargo.toml b/stratum/Cargo.toml index c62c9c81b..35d8d07b4 100644 --- a/stratum/Cargo.toml +++ b/stratum/Cargo.toml @@ -6,16 +6,16 @@ license = "GPL-3.0" authors = ["Parity Technologies "] [dependencies] -log = "0.3" +ethcore-bigint = { path = "../util/bigint" } +ethcore-logger = { path = "../logger" } +hash = { path = "../util/hash" } jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } jsonrpc-tcp-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } -ethcore-util = { path = "../util" } -ethcore-bigint = { path = "../util/bigint" } -ethcore-devtools = { path = "../devtools" } +log = "0.3" +parking_lot = "0.4" + +[dev-dependencies] env_logger = "0.4" tokio-core = "0.1" tokio-io = "0.1" -parking_lot = "0.4" -ethcore-logger = { path = "../logger" } -hash = { path = "../util/hash" } diff --git a/stratum/src/lib.rs b/stratum/src/lib.rs index 229f36acc..63a2804e0 100644 --- a/stratum/src/lib.rs +++ b/stratum/src/lib.rs @@ -20,7 +20,6 @@ extern crate jsonrpc_tcp_server; extern crate jsonrpc_core; extern crate jsonrpc_macros; #[macro_use] extern crate log; -extern crate ethcore_util as util; extern crate ethcore_bigint as bigint; extern crate hash; extern crate parking_lot; @@ -28,7 +27,6 @@ extern crate parking_lot; #[cfg(test)] extern crate tokio_core; #[cfg(test)] extern crate tokio_io; #[cfg(test)] extern crate ethcore_logger; -#[cfg(test)] extern crate env_logger; mod traits; diff --git a/sync/Cargo.toml b/sync/Cargo.toml index a1941fec4..970d47bca 100644 --- a/sync/Cargo.toml +++ b/sync/Cargo.toml @@ -34,7 +34,6 @@ ipnetwork = "0.12.6" [dev-dependencies] ethkey = { path = "../ethkey" } kvdb-memorydb = { path = "../util/kvdb-memorydb" } -ethcore-devtools = { path = "../devtools" } [features] default = [] diff --git a/sync/src/lib.rs b/sync/src/lib.rs index 0495d72a7..caa8cb22d 100644 --- a/sync/src/lib.rs +++ b/sync/src/lib.rs @@ -46,7 +46,6 @@ extern crate kvdb; extern crate ethcore_light as light; -#[cfg(test)] extern crate ethcore_devtools as devtools; #[cfg(test)] extern crate ethkey; #[cfg(test)] extern crate kvdb_memorydb;