Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): update rand requirement from 0.7.2 to 0.8.0 #488

Merged
merged 9 commits into from Jan 4, 2021
2 changes: 1 addition & 1 deletion ethbloom/Cargo.toml
Expand Up @@ -19,7 +19,7 @@ impl-codec = { version = "0.4.1", path = "../primitive-types/impls/codec", defau

[dev-dependencies]
criterion = "0.3.0"
rand = "0.7.2"
rand = "0.8.0"
hex-literal = "0.3.1"

[features]
Expand Down
3 changes: 2 additions & 1 deletion fixed-hash/Cargo.toml
Expand Up @@ -16,14 +16,15 @@ features = ["quickcheck", "api-dummy"]
[dependencies]
byteorder = { version = "1.3.2", optional = true, default-features = false }
quickcheck = { version = "0.9.0", optional = true }
rand = { version = "0.7.2", optional = true, default-features = false }
rand = { version = "0.8.0", optional = true, default-features = false }
rustc-hex = { version = "2.0.1", optional = true, default-features = false }
static_assertions = "1.0.0"
arbitrary = { version = "0.4", optional = true }

[dev-dependencies]
rand_xorshift = "0.2.0"
criterion = "0.3.0"
rand = { version = "0.8.0", default-features = false, features = ["std_rng"] }

[features]
default = ["std", "rand", "rustc-hex", "byteorder"]
Expand Down
19 changes: 2 additions & 17 deletions fixed-hash/src/tests.rs
Expand Up @@ -244,23 +244,8 @@ mod rand {

#[test]
fn random() {
let default_seed = <StdRng as SeedableRng>::Seed::default();
let mut rng = StdRng::from_seed(default_seed);
assert_eq!(H32::random_using(&mut rng), H32::from([0x76, 0xa0, 0x40, 0x53]));
}

#[test]
fn randomize() {
let default_seed = <StdRng as SeedableRng>::Seed::default();
let mut rng = StdRng::from_seed(default_seed);
assert_eq!(
{
let mut ret = H32::zero();
ret.randomize_using(&mut rng);
ret
},
H32::from([0x76, 0xa0, 0x40, 0x53])
)
let mut rng = StdRng::seed_from_u64(123);
assert_eq!(H32::random_using(&mut rng), H32::from([0xeb, 0x96, 0xaf, 0x1c]));
}
}

Expand Down
2 changes: 1 addition & 1 deletion kvdb-rocksdb/Cargo.toml
Expand Up @@ -28,7 +28,7 @@ alloc_counter = "0.0.4"
criterion = "0.3"
ethereum-types = { path = "../ethereum-types" }
kvdb-shared-tests = { path = "../kvdb-shared-tests", version = "0.6" }
rand = "0.7.2"
rand = "0.8.0"
tempfile = "3.1.0"
keccak-hash = { path = "../keccak-hash" }
sysinfo = "0.15.3"
Expand Down
2 changes: 1 addition & 1 deletion kvdb-rocksdb/benches/bench_read_perf.rs
Expand Up @@ -50,7 +50,7 @@ fn open_db() -> Database {
/// an `ElasticArray128` so sometimes we save on allocations.
fn n_random_bytes(n: usize) -> Vec<u8> {
let mut rng = rand::thread_rng();
let variability: i64 = rng.gen_range(0, (n / 5) as i64);
let variability: i64 = rng.gen_range(0 .. (n / 5) as i64);
let plus_or_minus: i64 = if variability % 2 == 0 { 1 } else { -1 };
let range = Uniform::from(0..u8::max_value());
rng.sample_iter(&range).take((n as i64 + plus_or_minus * variability) as usize).collect()
Expand Down
1 change: 0 additions & 1 deletion parity-crypto/Cargo.toml
Expand Up @@ -22,7 +22,6 @@ ethereum-types = { version = "0.10.0", optional = true, path = "../ethereum-type
hmac = "0.10.1"
lazy_static = { version = "1.4.0", optional = true }
pbkdf2 = "0.6.0"
rand = "0.7.3"
ripemd160 = "0.9.1"
rustc-hex = { version = "2.1.0", default-features = false, optional = true }
scrypt = { version = "0.5.0" }
Expand Down
1 change: 0 additions & 1 deletion parity-crypto/src/publickey/secret_key.rs
Expand Up @@ -8,7 +8,6 @@

//! Secret key implementation.

use std::convert::TryFrom;
use std::fmt;
use std::ops::Deref;
use std::str::FromStr;
Expand Down
4 changes: 2 additions & 2 deletions uint/Cargo.toml
Expand Up @@ -13,15 +13,15 @@ edition = "2018"
byteorder = { version = "1.3.2", default-features = false }
crunchy = { version = "0.2.2", default-features = false }
qc = { package = "quickcheck", version = "0.9.0", optional = true }
rand = { version = "0.7.2", default-features = false, optional = true }
rand07 = { package = "rand", version = "0.7", default-features = false, optional = true }
hex = { version = "0.4", default-features = false }
static_assertions = "1.0.0"
arbitrary = { version = "0.4", optional = true }

[features]
default = ["std"]
std = ["byteorder/std", "crunchy/std", "hex/std"]
quickcheck = ["qc", "rand"]
quickcheck = ["qc", "rand07"]

[[example]]
name = "modular"
Expand Down
2 changes: 1 addition & 1 deletion uint/src/lib.rs
Expand Up @@ -27,7 +27,7 @@ pub use qc;

#[cfg(feature = "quickcheck")]
#[doc(hidden)]
pub use rand;
pub use rand07;

#[cfg(feature = "arbitrary")]
#[doc(hidden)]
Expand Down
4 changes: 2 additions & 2 deletions uint/src/uint.rs
Expand Up @@ -1742,8 +1742,8 @@ macro_rules! impl_quickcheck_arbitrary_for_uint {
fn arbitrary<G: $crate::qc::Gen>(g: &mut G) -> Self {
let mut res = [0u8; $n_bytes];

use $crate::rand::Rng;
let p: f64 = $crate::rand::rngs::OsRng.gen();
use $crate::rand07::Rng;
let p: f64 = $crate::rand07::rngs::OsRng.gen();
// make it more likely to generate smaller numbers that
// don't use up the full $n_bytes
let range =
Expand Down