Skip to content

Commit 0e27005

Browse files
authored
Merge branch 'master' into fix-reseal-min-period
2 parents ea09f3b + a766381 commit 0e27005

File tree

19 files changed

+128
-46
lines changed

19 files changed

+128
-46
lines changed

Cargo.lock

Lines changed: 99 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ memorydb = { path = "../util/memorydb" }
3333
multimap = { path = "../util/multimap" }
3434
parking_lot = "0.6.0"
3535
primitives = { path = "../util/primitives" }
36-
rand = "0.5.3"
36+
rand = "0.6.1"
3737
rlp = { path = "../util/rlp" }
3838
rlp_compress = { path = "../util/rlp_compress" }
3939
rlp_derive = { path = "../util/rlp_derive" }

core/src/consensus/tendermint/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ use ctypes::util::unexpected::{Mismatch, OutOfBounds};
3232
use ctypes::BlockNumber;
3333
use parking_lot::{Mutex, ReentrantMutex, RwLock};
3434
use primitives::{u256_from_u128, Bytes, H256, U256};
35-
use rand::{thread_rng, Rng};
35+
use rand::prelude::SliceRandom;
36+
use rand::thread_rng;
3637
use rlp::{Encodable, UntrustedRlp};
3738
use time::Duration;
3839

@@ -996,7 +997,7 @@ impl TendermintExtension {
996997
let mut count = (peers.len() as f64).powf(0.5).round() as usize;
997998
count = cmp::min(count, MAX_PEERS_PROPAGATION);
998999
count = cmp::max(count, MIN_PEERS_PROPAGATION);
999-
thread_rng().shuffle(&mut peers);
1000+
peers.shuffle(&mut thread_rng());
10001001
peers.truncate(count);
10011002
peers
10021003
}

crypto/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ rust-crypto = "0.2.36"
1010
primitives = { path = "../util/primitives" }
1111

1212
[dev-dependencies]
13-
rand = "0.5.3"
13+
rand = "0.6.1"

discovery/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ codechain-timer = { path = "../util/timer" }
1212
log = "0.4.6"
1313
parking_lot = "0.6.0"
1414
primitives = { path = "../util/primitives" }
15-
rand = "0.5.3"
15+
rand = "0.6.1"
1616
rlp = { path = "../util/rlp" }
1717
time = "0.1"
1818

discovery/src/unstructured/extension.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ use std::sync::Arc;
2020
use cnetwork::{Api, DiscoveryApi, IntoSocketAddr, NetworkExtension, NodeId, RoutingTable};
2121
use ctimer::{TimeoutHandler, TimerToken};
2222
use parking_lot::RwLock;
23-
use rand::{thread_rng, Rng};
23+
use rand::prelude::SliceRandom;
24+
use rand::thread_rng;
2425
use rlp::{Decodable, Encodable, UntrustedRlp};
2526
use time::Duration;
2627

@@ -100,7 +101,7 @@ impl NetworkExtension for Extension {
100101
if let (Some(api), Some(routing_table)) = (&*api, &*routing_table) {
101102
let mut addresses =
102103
routing_table.reachable_addresses(&node.into_addr()).into_iter().collect::<Vec<_>>();
103-
thread_rng().shuffle(&mut addresses);
104+
addresses.shuffle(&mut thread_rng());
104105
let addresses =
105106
addresses.into_iter().take(::std::cmp::min(self.config.bucket_size, len) as usize).collect();
106107
let response = Message::Response(addresses).rlp_bytes();

key/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["debris <[email protected]>", "CodeChain Team <[email protected]>"]
55

66
[dependencies]
7-
rand = "0.5.3"
7+
rand = "0.6.1"
88
rustc-hex = "1.0"
99
rustc-serialize = "0.3"
1010
lazy_static = "1.2"

key/src/random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1616

1717
use crate::{Generator, KeyPair, SECP256K1};
18-
use rand::os::OsRng;
18+
use rand::rngs::OsRng;
1919

2020
pub struct Random;
2121

keystore/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["CodeChain Team <[email protected]>", "Parity Technologies <admin@
66
[dependencies]
77
log = "0.4.6"
88
libc = "0.2"
9-
rand = "0.5.3"
9+
rand = "0.6.1"
1010
codechain-json = { path = "../json" }
1111
codechain-key = { path = "../key" }
1212
codechain-types = { path = "../types" }

keystore/src/random.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
1616

1717
use rand::distributions::Alphanumeric;
18-
use rand::{OsRng, Rng, RngCore};
18+
use rand::rngs::OsRng;
19+
use rand::{Rng, RngCore};
1920

2021
pub trait Random {
2122
fn random() -> Self

0 commit comments

Comments
 (0)