diff --git a/README.md b/README.md index be31c49243e..0775238509f 100644 --- a/README.md +++ b/README.md @@ -296,10 +296,6 @@ Caching, Importing Blocks, and Block Information ```bash ethcore-logger ``` -* C bindings library for the Parity Ethereum client - ```bash - parity-clib - ``` * Parity Ethereum JSON-RPC Servers ```bash parity-rpc @@ -318,7 +314,7 @@ Caching, Importing Blocks, and Block Information journaldb keccak-hasher len-caching-lock macros memory-cache memzero migration-rocksdb ethcore-network ethcore-network-devp2p panic_hook patricia-trie-ethereum registrar rlp_compress rlp_derive parity-runtime stats - time-utils triehash-ethereum unexpected parity-version + triehash-ethereum unexpected parity-version ```
diff --git a/ethcore/engines/authority-round/Cargo.toml b/ethcore/engines/authority-round/Cargo.toml index 11b46be2bdd..a6272164c93 100644 --- a/ethcore/engines/authority-round/Cargo.toml +++ b/ethcore/engines/authority-round/Cargo.toml @@ -31,7 +31,6 @@ parity-bytes = "0.1" parking_lot = "0.9" rand = "0.7" rlp = "0.4.0" -time-utils = { path = "../../../util/time-utils" } unexpected = { path = "../../../util/unexpected" } validator-set = { path = "../validator-set" } diff --git a/ethcore/engines/authority-round/src/lib.rs b/ethcore/engines/authority-round/src/lib.rs index 7d4c6e86c0f..9ec32d98bf5 100644 --- a/ethcore/engines/authority-round/src/lib.rs +++ b/ethcore/engines/authority-round/src/lib.rs @@ -62,7 +62,6 @@ use rlp::{encode, Decodable, DecoderError, Encodable, RlpStream, Rlp}; use ethereum_types::{H256, H520, Address, U128, U256}; use parity_bytes::Bytes; use parking_lot::{Mutex, RwLock}; -use time_utils::CheckedSystemTime; use common_types::{ ancestry_action::AncestryAction, BlockNumber, @@ -759,10 +758,10 @@ fn verify_timestamp(step: &Step, header_step: u64) -> Result<(), BlockError> { // Returning it further won't recover the sync process. trace!(target: "engine", "verify_timestamp: block too early"); - let found = CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(oob.found)) + let found = UNIX_EPOCH.checked_add(Duration::from_secs(oob.found)) .ok_or(BlockError::TimestampOverflow)?; - let max = oob.max.and_then(|m| CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(m))); - let min = oob.min.and_then(|m| CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(m))); + let max = oob.max.and_then(|m| UNIX_EPOCH.checked_add(Duration::from_secs(m))); + let min = oob.min.and_then(|m| UNIX_EPOCH.checked_add(Duration::from_secs(m))); let new_oob = OutOfBounds { min, max, found }; diff --git a/ethcore/engines/clique/Cargo.toml b/ethcore/engines/clique/Cargo.toml index 7a73f04c815..dc4d966e259 100644 --- a/ethcore/engines/clique/Cargo.toml +++ b/ethcore/engines/clique/Cargo.toml @@ -22,7 +22,6 @@ macros = { path = "../../../util/macros" } rand = "0.7" parking_lot = "0.9" rlp = "0.4.0" -time-utils = { path = "../../../util/time-utils" } unexpected = { path = "../../../util/unexpected" } [dev-dependencies] diff --git a/ethcore/engines/clique/src/block_state.rs b/ethcore/engines/clique/src/block_state.rs index a6f8103571e..3685c468736 100644 --- a/ethcore/engines/clique/src/block_state.rs +++ b/ethcore/engines/clique/src/block_state.rs @@ -28,7 +28,6 @@ use common_types::{ use ethereum_types::{Address, H64}; use log::{debug, trace}; use rand::Rng; -use time_utils::CheckedSystemTime; use unexpected::Mismatch; use crate::{ @@ -273,7 +272,7 @@ impl CliqueBlockState { // This is a quite bad API because we must mutate both variables even when already `inturn` fails // That's why we can't return early and must have the `if-else` in the end pub fn calc_next_timestamp(&mut self, timestamp: u64, period: u64) -> Result<(), Error> { - let inturn = CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(timestamp.saturating_add(period))); + let inturn = UNIX_EPOCH.checked_add(Duration::from_secs(timestamp.saturating_add(period))); self.next_timestamp_inturn = inturn; diff --git a/ethcore/engines/clique/src/lib.rs b/ethcore/engines/clique/src/lib.rs index 6638897edb3..f5c8bc32a7f 100644 --- a/ethcore/engines/clique/src/lib.rs +++ b/ethcore/engines/clique/src/lib.rs @@ -84,7 +84,6 @@ use macros::map; use parking_lot::RwLock; use rand::Rng; use unexpected::{Mismatch, OutOfBounds}; -use time_utils::CheckedSystemTime; use common_types::{ BlockNumber, ids::BlockId, @@ -571,7 +570,7 @@ impl Engine for Clique { // Don't waste time checking blocks from the future { - let limit = CheckedSystemTime::checked_add(SystemTime::now(), Duration::from_secs(self.period)) + let limit = SystemTime::now().checked_add(Duration::from_secs(self.period)) .ok_or(BlockError::TimestampOverflow)?; // This should succeed under the constraints that the system clock works @@ -581,7 +580,7 @@ impl Engine for Clique { let hdr = Duration::from_secs(header.timestamp()); if hdr > limit_as_dur { - let found = CheckedSystemTime::checked_add(UNIX_EPOCH, hdr).ok_or(BlockError::TimestampOverflow)?; + let found = UNIX_EPOCH.checked_add(hdr).ok_or(BlockError::TimestampOverflow)?; Err(BlockError::TemporarilyInvalid(OutOfBounds { min: None, @@ -692,8 +691,8 @@ impl Engine for Clique { // Ensure that the block's timestamp isn't too close to it's parent let limit = parent.timestamp().saturating_add(self.period); if limit > header.timestamp() { - let max = CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(header.timestamp())); - let found = CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(limit)) + let max = UNIX_EPOCH.checked_add(Duration::from_secs(header.timestamp())); + let found = UNIX_EPOCH.checked_add(Duration::from_secs(limit)) .ok_or(BlockError::TimestampOverflow)?; Err(BlockError::InvalidTimestamp(OutOfBounds { diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 9139c35425a..fd453dbb6c9 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -44,7 +44,6 @@ serde_derive = "1.0" serde_json = "1.0" spec = { path = "../spec" } state-db = { path = "../state-db" } -time-utils = { path = "../../util/time-utils" } tiny-keccak = "1.4" trace = { path = "../trace" } transaction-pool = "2.0.1" diff --git a/ethcore/private-tx/src/lib.rs b/ethcore/private-tx/src/lib.rs index a0ebb2cbdba..498e6789f80 100644 --- a/ethcore/private-tx/src/lib.rs +++ b/ethcore/private-tx/src/lib.rs @@ -71,9 +71,6 @@ extern crate derive_more; extern crate rlp_derive; extern crate vm; -#[cfg(not(time_checked_add))] -extern crate time_utils; - #[cfg(test)] extern crate env_logger; diff --git a/ethcore/private-tx/src/log.rs b/ethcore/private-tx/src/log.rs index 44b473bca2e..aefeba41012 100644 --- a/ethcore/private-tx/src/log.rs +++ b/ethcore/private-tx/src/log.rs @@ -26,9 +26,6 @@ use parking_lot::RwLock; use serde::ser::{Serializer, SerializeSeq}; use error::Error; -#[cfg(not(time_checked_add))] -use time_utils::CheckedSystemTime; - /// Maximum amount of stored private transaction logs. const MAX_JOURNAL_LEN: usize = 1000; @@ -331,9 +328,6 @@ mod tests { use parking_lot::RwLock; use super::{TransactionLog, Logging, PrivateTxStatus, LogsSerializer, ValidatorLog}; - #[cfg(not(time_checked_add))] - use time_utils::CheckedSystemTime; - struct StringLogSerializer { string_log: RwLock