From e7a708ac21a191c2c0131022573c6c4068306149 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 11:59:42 +0100 Subject: [PATCH 1/3] build(deps): update secp256k1 requirement from 0.19.0 to 0.20.0 (#496) Updates the requirements on [secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) to permit the latest version. - [Release notes](https://github.com/rust-bitcoin/rust-secp256k1/releases) - [Changelog](https://github.com/rust-bitcoin/rust-secp256k1/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-bitcoin/rust-secp256k1/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andronik Ordian --- parity-crypto/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parity-crypto/Cargo.toml b/parity-crypto/Cargo.toml index 97bfe1581..6a2f1a1fb 100644 --- a/parity-crypto/Cargo.toml +++ b/parity-crypto/Cargo.toml @@ -26,7 +26,7 @@ rand = "0.7.3" ripemd160 = "0.9.1" rustc-hex = { version = "2.1.0", default-features = false, optional = true } scrypt = { version = "0.5.0" } -secp256k1 = { version = "0.19.0", optional = true, features = ["global-context", "recovery", "rand-std"] } +secp256k1 = { version = "0.20.0", optional = true, features = ["global-context", "recovery", "rand-std"] } sha2 = "0.9.2" subtle = "2.4.0" tiny-keccak = { version = "2.0.2", features = ["keccak"] } From a7003bce517cf5703ffb235a00005bd65c08cf32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 13:44:54 +0000 Subject: [PATCH 2/3] build(deps): update smallvec requirement from 0.6.10 to 1.6.0 (#494) Updates the requirements on [smallvec](https://github.com/servo/rust-smallvec) to permit the latest version. - [Release notes](https://github.com/servo/rust-smallvec/releases) - [Commits](https://github.com/servo/rust-smallvec/commits/v1.6.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andronik Ordian --- transaction-pool/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transaction-pool/Cargo.toml b/transaction-pool/Cargo.toml index a0de36b27..fcd193618 100644 --- a/transaction-pool/Cargo.toml +++ b/transaction-pool/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] log = "0.4.8" -smallvec = "0.6.10" +smallvec = "1.6.0" trace-time = { path = "../trace-time", version = "0.1" } [dev-dependencies] From 2c8cd78d9b03fba2d096abb8b90dc15a7b74d7e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 14:49:58 +0000 Subject: [PATCH 3/3] build(deps): update rand requirement from 0.7.2 to 0.8.0 (#488) * build(deps): update rand requirement from 0.7.2 to 0.8.0 Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.7.3...0.8.0) Signed-off-by: dependabot[bot] * Seed from u64 * uint: use rand 0.7 for quickcheck feature * kvdb-rocksdb: fix compilation for benches * parity-crypto: remove unused dep and fix a warning * cargo fmt and another unused dep Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andronik Ordian Co-authored-by: David Palm --- ethbloom/Cargo.toml | 2 +- fixed-hash/Cargo.toml | 3 ++- fixed-hash/src/tests.rs | 19 ++----------------- kvdb-rocksdb/Cargo.toml | 2 +- kvdb-rocksdb/benches/bench_read_perf.rs | 2 +- parity-crypto/Cargo.toml | 1 - parity-crypto/src/publickey/secret_key.rs | 1 - transaction-pool/Cargo.toml | 1 - uint/Cargo.toml | 4 ++-- uint/src/lib.rs | 2 +- uint/src/uint.rs | 4 ++-- 11 files changed, 12 insertions(+), 29 deletions(-) diff --git a/ethbloom/Cargo.toml b/ethbloom/Cargo.toml index 7d21efd5d..c8223ecf3 100644 --- a/ethbloom/Cargo.toml +++ b/ethbloom/Cargo.toml @@ -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] diff --git a/fixed-hash/Cargo.toml b/fixed-hash/Cargo.toml index c8e85585f..3fa37cafc 100644 --- a/fixed-hash/Cargo.toml +++ b/fixed-hash/Cargo.toml @@ -16,7 +16,7 @@ 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 } @@ -24,6 +24,7 @@ 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"] diff --git a/fixed-hash/src/tests.rs b/fixed-hash/src/tests.rs index 33c1956b7..5a5f5d94d 100644 --- a/fixed-hash/src/tests.rs +++ b/fixed-hash/src/tests.rs @@ -244,23 +244,8 @@ mod rand { #[test] fn random() { - let default_seed = ::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 = ::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])); } } diff --git a/kvdb-rocksdb/Cargo.toml b/kvdb-rocksdb/Cargo.toml index e623914d9..77ba7aed0 100644 --- a/kvdb-rocksdb/Cargo.toml +++ b/kvdb-rocksdb/Cargo.toml @@ -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" diff --git a/kvdb-rocksdb/benches/bench_read_perf.rs b/kvdb-rocksdb/benches/bench_read_perf.rs index 3a14ac752..5a956020b 100644 --- a/kvdb-rocksdb/benches/bench_read_perf.rs +++ b/kvdb-rocksdb/benches/bench_read_perf.rs @@ -50,7 +50,7 @@ fn open_db() -> Database { /// an `ElasticArray128` so sometimes we save on allocations. fn n_random_bytes(n: usize) -> Vec { 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() diff --git a/parity-crypto/Cargo.toml b/parity-crypto/Cargo.toml index 6a2f1a1fb..828886648 100644 --- a/parity-crypto/Cargo.toml +++ b/parity-crypto/Cargo.toml @@ -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" } diff --git a/parity-crypto/src/publickey/secret_key.rs b/parity-crypto/src/publickey/secret_key.rs index 80a37a590..7f5692f1d 100644 --- a/parity-crypto/src/publickey/secret_key.rs +++ b/parity-crypto/src/publickey/secret_key.rs @@ -8,7 +8,6 @@ //! Secret key implementation. -use std::convert::TryFrom; use std::fmt; use std::ops::Deref; use std::str::FromStr; diff --git a/transaction-pool/Cargo.toml b/transaction-pool/Cargo.toml index fcd193618..fd9a4fbd6 100644 --- a/transaction-pool/Cargo.toml +++ b/transaction-pool/Cargo.toml @@ -10,7 +10,6 @@ edition = "2018" [dependencies] log = "0.4.8" smallvec = "1.6.0" -trace-time = { path = "../trace-time", version = "0.1" } [dev-dependencies] ethereum-types = { version = "0.10.0", path = "../ethereum-types" } diff --git a/uint/Cargo.toml b/uint/Cargo.toml index b27645ac6..ca650e72e 100644 --- a/uint/Cargo.toml +++ b/uint/Cargo.toml @@ -13,7 +13,7 @@ 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 } @@ -21,7 +21,7 @@ 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" diff --git a/uint/src/lib.rs b/uint/src/lib.rs index 0aedc11d8..83ab957a2 100644 --- a/uint/src/lib.rs +++ b/uint/src/lib.rs @@ -27,7 +27,7 @@ pub use qc; #[cfg(feature = "quickcheck")] #[doc(hidden)] -pub use rand; +pub use rand07; #[cfg(feature = "arbitrary")] #[doc(hidden)] diff --git a/uint/src/uint.rs b/uint/src/uint.rs index 3d625368e..27bd0be96 100644 --- a/uint/src/uint.rs +++ b/uint/src/uint.rs @@ -1742,8 +1742,8 @@ macro_rules! impl_quickcheck_arbitrary_for_uint { fn arbitrary(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 =