From 6bebb9e74a2ecae205cde43abea4f43689c424eb Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Fri, 19 Jan 2018 13:46:31 +0100 Subject: [PATCH] Moved StopGaurd to it's own crate (#7635) --- Cargo.lock | 5 +++++ devtools/src/lib.rs | 2 -- ethcore/Cargo.toml | 1 + ethcore/src/lib.rs | 1 + ethcore/src/service.rs | 5 +++-- util/stop-guard/Cargo.toml | 6 ++++++ devtools/src/stop_guard.rs => util/stop-guard/src/lib.rs | 0 7 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 util/stop-guard/Cargo.toml rename devtools/src/stop_guard.rs => util/stop-guard/src/lib.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index dac677350..f5cffa8da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -486,6 +486,7 @@ dependencies = [ "semantic_version 0.1.0", "snappy 0.1.0 (git+https://github.com/paritytech/rust-snappy)", "stats 0.1.0", + "stop-guard 0.1.0", "table 0.1.0", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", "triehash 0.1.0", @@ -2975,6 +2976,10 @@ dependencies = [ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "stop-guard" +version = "0.1.0" + [[package]] name = "strsim" version = "0.6.0" diff --git a/devtools/src/lib.rs b/devtools/src/lib.rs index 419f0d642..ba60223da 100644 --- a/devtools/src/lib.rs +++ b/devtools/src/lib.rs @@ -21,9 +21,7 @@ extern crate rand; mod random_path; mod test_socket; -mod stop_guard; pub mod http_client; pub use random_path::*; pub use test_socket::*; -pub use stop_guard::*; diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 5ea54d2b0..55fe8fa27 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -53,6 +53,7 @@ kvdb-rocksdb = { path = "../util/kvdb-rocksdb" } kvdb-memorydb = { path = "../util/kvdb-memorydb" } util-error = { path = "../util/error" } snappy = { git = "https://github.com/paritytech/rust-snappy" } +stop-guard = { path = "../util/stop-guard" } migration = { path = "../util/migration" } macros = { path = "../util/macros" } rust-crypto = "0.2.34" diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 12ee0e45f..be4ad9646 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -105,6 +105,7 @@ extern crate migration; extern crate rlp_derive; extern crate rustc_hex; extern crate stats; +extern crate stop_guard; extern crate time; extern crate using_queue; extern crate table; diff --git a/ethcore/src/service.rs b/ethcore/src/service.rs index f462e73f1..10bf6f3c3 100644 --- a/ethcore/src/service.rs +++ b/ethcore/src/service.rs @@ -31,6 +31,7 @@ use miner::Miner; use snapshot::{ManifestData, RestorationStatus}; use snapshot::service::{Service as SnapshotService, ServiceParams as SnapServiceParams}; use ansi_term::Colour; +use stop_guard::StopGuard; /// Message type for external and internal events #[derive(Clone, PartialEq, Eq, Debug)] @@ -59,7 +60,7 @@ pub struct ClientService { client: Arc, snapshot: Arc, database: Arc, - _stop_guard: ::devtools::StopGuard, + _stop_guard: StopGuard, } impl ClientService { @@ -111,7 +112,7 @@ impl ClientService { spec.engine.register_client(Arc::downgrade(&client) as _); - let stop_guard = ::devtools::StopGuard::new(); + let stop_guard = StopGuard::new(); Ok(ClientService { io_service: Arc::new(io_service), diff --git a/util/stop-guard/Cargo.toml b/util/stop-guard/Cargo.toml new file mode 100644 index 000000000..bf870fb61 --- /dev/null +++ b/util/stop-guard/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "stop-guard" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] diff --git a/devtools/src/stop_guard.rs b/util/stop-guard/src/lib.rs similarity index 100% rename from devtools/src/stop_guard.rs rename to util/stop-guard/src/lib.rs