Deduplicating crate dependencies (part 3 of n) (#11614)

* Deduplicating crate dependencies (part 3 of n, `tiny_keccak`, `tokio-timer`, and co) (#11613)

The change includes:
```
tiny-keccak
tokio-timer
textwrap
winapi
rand
rand_xorshift
scopeguard
url
```

* Update rpc/src/v1/helpers/secretstore.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Update util/network-devp2p/src/connection.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
Valentin Shergin
2020-04-09 02:03:27 -07:00
committed by GitHub
parent 12cbe93fbe
commit a5820b6ef9
24 changed files with 67 additions and 93 deletions

View File

@@ -23,7 +23,7 @@ use bytes::Bytes;
use jsonrpc_core::Error;
use v1::helpers::errors;
use v1::types::EncryptedDocumentKey;
use tiny_keccak::Keccak;
use tiny_keccak::{Keccak, Hasher};
/// Initialization vector length.
const INIT_VEC_LEN: usize = 16;
@@ -95,7 +95,7 @@ pub fn decrypt_document_with_shadow(decrypted_secret: Public, common_point: Publ
/// Calculate Keccak(ordered servers set)
pub fn ordered_servers_keccak(servers_set: BTreeSet<H512>) -> H256 {
let mut servers_set_keccak = Keccak::new_keccak256();
let mut servers_set_keccak = Keccak::v256();
for server in servers_set {
servers_set_keccak.update(&server.0);
}

View File

@@ -17,7 +17,7 @@
//! Parity-specific PUB-SUB rpc implementation.
use std::sync::Arc;
use std::time::Duration;
use std::time::{Duration, Instant};
use parking_lot::RwLock;
use jsonrpc_core::{self as core, Result, MetaIoHandler};
@@ -43,12 +43,8 @@ impl<S: core::Middleware<Metadata>> PubSubClient<S> {
let poll_manager = Arc::new(RwLock::new(GenericPollManager::new(rpc)));
let pm2 = Arc::downgrade(&poll_manager);
let timer = tokio_timer::wheel()
.tick_duration(Duration::from_millis(500))
.build();
// Start ticking
let interval = timer.interval(Duration::from_millis(1000));
let interval = tokio_timer::Interval::new(Instant::now() + Duration::from_millis(500), Duration::from_millis(1000));
executor.spawn(interval
.map_err(|e| warn!("Polling timer error: {:?}", e))
.for_each(move |_| {