Skip to content

update rand to 0.7 (breaking change) #217

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

Merged
merged 7 commits into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contract-address/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract-address"
version = "0.2.0"
version = "0.3.0"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
homepage = "https://github.com/paritytech/parity-common"
Expand All @@ -11,9 +11,9 @@ edition = "2018"
readme = "README.md"

[dependencies]
ethereum-types = { version = "0.7", path = "../ethereum-types" }
ethereum-types = { version = "0.8", path = "../ethereum-types" }
rlp = { version = "0.4", path = "../rlp" }
keccak-hash = { version = "0.3", path = "../keccak-hash", default-features = false }
keccak-hash = { version = "0.4", path = "../keccak-hash", default-features = false }

[features]
default = []
Expand Down
4 changes: 2 additions & 2 deletions ethbloom/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethbloom"
version = "0.7.0"
version = "0.8.0"
authors = ["Parity Technologies <[email protected]>"]
description = "Ethereum bloom filter"
license = "MIT"
Expand All @@ -12,7 +12,7 @@ edition = "2018"
[dependencies]
tiny-keccak = "1.5"
crunchy = { version = "0.2", default-features = false, features = ["limit_256"] }
fixed-hash = { path = "../fixed-hash", version = "0.4", default-features = false }
fixed-hash = { path = "../fixed-hash", version = "0.5", default-features = false }
impl-serde = { path = "../primitive-types/impls/serde", version = "0.2", default-features = false, optional = true }
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.2", default-features = false }

Expand Down
8 changes: 4 additions & 4 deletions ethereum-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "ethereum-types"
version = "0.7.0"
version = "0.8.0"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
homepage = "https://github.com/paritytech/parity-common"
description = "Ethereum types"
edition = "2018"

[dependencies]
ethbloom = { path = "../ethbloom", version = "0.7", default-features = false }
fixed-hash = { path = "../fixed-hash", version = "0.4", default-features = false, features = ["byteorder", "rustc-hex"] }
ethbloom = { path = "../ethbloom", version = "0.8", default-features = false }
fixed-hash = { path = "../fixed-hash", version = "0.5", default-features = false, features = ["byteorder", "rustc-hex"] }
uint-crate = { path = "../uint", package = "uint", version = "0.8", default-features = false }
primitive-types = { path = "../primitive-types", version = "0.5", features = ["rlp", "byteorder", "rustc-hex"], default-features = false }
primitive-types = { path = "../primitive-types", version = "0.6", features = ["rlp", "byteorder", "rustc-hex"], default-features = false }
impl-serde = { path = "../primitive-types/impls/serde", version = "0.2", default-features = false, optional = true }
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.2", default-features = false }

Expand Down
7 changes: 5 additions & 2 deletions fixed-hash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fixed-hash"
version = "0.4.0"
version = "0.5.0"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
homepage = "https://github.com/paritytech/parity-common"
Expand All @@ -13,12 +13,15 @@ readme = "README.md"
features = ["quickcheck", "api-dummy"]

[dependencies]
rand = { version = "0.5", optional = true, default-features = false }
rand = { version = "0.7", optional = true, default-features = false }
rustc-hex = { version = "2.0", optional = true, default-features = false }
quickcheck = { version = "0.7", optional = true }
byteorder = { version = "1.2", optional = true, default-features = false }
static_assertions = "0.2"

[dev-dependencies]
rand_xorshift = "0.2.0"

[target.'cfg(not(target_os = "unknown"))'.dependencies]
libc = { version = "0.2", optional = true, default-features = false }

Expand Down
26 changes: 13 additions & 13 deletions fixed-hash/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ macro_rules! construct_fixed_hash {

impl<'a> From<&'a [u8; $n_bytes]> for $name {
/// Constructs a hash type from the given reference
/// to the bytes array of fixed length.
/// to the bytes array of fixed length.
///
/// # Note
///
Expand All @@ -80,7 +80,7 @@ macro_rules! construct_fixed_hash {

impl<'a> From<&'a mut [u8; $n_bytes]> for $name {
/// Constructs a hash type from the given reference
/// to the mutable bytes array of fixed length.
/// to the mutable bytes array of fixed length.
///
/// # Note
///
Expand Down Expand Up @@ -328,7 +328,7 @@ macro_rules! construct_fixed_hash {
}

// Implementation for disabled byteorder crate support.
//
//
// # Note
//
// Feature guarded macro definitions instead of feature guarded impl blocks
Expand All @@ -342,7 +342,7 @@ macro_rules! impl_byteorder_for_fixed_hash {
}

// Implementation for enabled byteorder crate support.
//
//
// # Note
//
// Feature guarded macro definitions instead of feature guarded impl blocks
Expand Down Expand Up @@ -461,7 +461,7 @@ macro_rules! impl_byteorder_for_fixed_hash {
}

// Implementation for disabled rand crate support.
//
//
// # Note
//
// Feature guarded macro definitions instead of feature guarded impl blocks
Expand All @@ -475,7 +475,7 @@ macro_rules! impl_rand_for_fixed_hash {
}

// Implementation for enabled rand crate support.
//
//
// # Note
//
// Feature guarded macro definitions instead of feature guarded impl blocks
Expand Down Expand Up @@ -512,7 +512,7 @@ macro_rules! impl_rand_for_fixed_hash {

/// Assign `self` to a cryptographically random value.
pub fn randomize(&mut self) {
let mut rng = $crate::rand::rngs::EntropyRng::new();
let mut rng = $crate::rand::rngs::OsRng;
self.randomize_using(&mut rng);
}

Expand All @@ -538,7 +538,7 @@ macro_rules! impl_rand_for_fixed_hash {
}

// Implementation for disabled libc crate support.
//
//
// # Note
//
// Feature guarded macro definitions instead of feature guarded impl blocks
Expand Down Expand Up @@ -566,7 +566,7 @@ macro_rules! impl_libc_for_fixed_hash {
}

// Implementation for enabled libc crate support.
//
//
// # Note
//
// Feature guarded macro definitions instead of feature guarded impl blocks
Expand Down Expand Up @@ -612,7 +612,7 @@ macro_rules! impl_libc_for_fixed_hash {
}

// Implementation for disabled rustc-hex crate support.
//
//
// # Note
//
// Feature guarded macro definitions instead of feature guarded impl blocks
Expand All @@ -626,7 +626,7 @@ macro_rules! impl_rustc_hex_for_fixed_hash {
}

// Implementation for enabled rustc-hex crate support.
//
//
// # Note
//
// Feature guarded macro definitions instead of feature guarded impl blocks
Expand Down Expand Up @@ -667,7 +667,7 @@ macro_rules! impl_rustc_hex_for_fixed_hash {
}

// Implementation for disabled quickcheck crate support.
//
//
// # Note
//
// Feature guarded macro definitions instead of feature guarded impl blocks
Expand All @@ -681,7 +681,7 @@ macro_rules! impl_quickcheck_for_fixed_hash {
}

// Implementation for enabled quickcheck crate support.
//
//
// # Note
//
// Feature guarded macro definitions instead of feature guarded impl blocks
Expand Down
3 changes: 3 additions & 0 deletions fixed-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ pub extern crate rand;
#[doc(hidden)]
pub extern crate quickcheck;

#[cfg(test)]
extern crate rand_xorshift;

#[macro_use]
mod hash;

Expand Down
3 changes: 2 additions & 1 deletion fixed-hash/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ mod from_low_u64 {
#[cfg(feature = "rand")]
mod rand {
use super::*;
use rand::{SeedableRng, XorShiftRng};
use rand::SeedableRng;
use rand_xorshift::XorShiftRng;

#[test]
fn random() {
Expand Down
4 changes: 2 additions & 2 deletions keccak-hash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "keccak-hash"
version = "0.3.0"
version = "0.4.0"
description = "`keccak-hash` is a set of utility functions to facilitate working with Keccak hashes (256/512 bits long)."
authors = ["Parity Technologies <[email protected]>"]
repository = "https://github.com/paritytech/parity-common"
Expand All @@ -10,7 +10,7 @@ edition = "2018"

[dependencies]
tiny-keccak = "1.4"
primitive-types = { path = "../primitive-types", version = "0.5", default-features = false }
primitive-types = { path = "../primitive-types", version = "0.6", default-features = false }

[dev-dependencies]
tempdir = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion kvdb-rocksdb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ parity-rocksdb = "0.5"

[dev-dependencies]
tempdir = "0.3"
ethereum-types = { version = "0.7", path = "../ethereum-types" }
ethereum-types = { version = "0.8", path = "../ethereum-types" }
4 changes: 2 additions & 2 deletions primitive-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "primitive-types"
version = "0.5.1"
version = "0.6.0"
authors = ["Parity Technologies <[email protected]>"]
license = "Apache-2.0/MIT"
homepage = "https://github.com/paritytech/parity-common"
description = "Primitive types shared by Ethereum and Substrate"

[dependencies]
fixed-hash = { version = "0.4", path = "../fixed-hash", default-features = false }
fixed-hash = { version = "0.5", path = "../fixed-hash", default-features = false }
uint = { version = "0.8", path = "../uint", default-features = false }
impl-serde = { version = "0.2.1", path = "impls/serde", default-features = false, optional = true }
impl-codec = { version = "0.4.1", path = "impls/codec", default-features = false, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion rlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rustc-hex = { version = "2.0", default-features = false }
[dev-dependencies]
criterion = "0.3"
hex-literal = "0.2"
primitive-types = { path = "../primitive-types", version = "0.5", features = ["impl-rlp"] }
primitive-types = { path = "../primitive-types", version = "0.6", features = ["impl-rlp"] }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion transaction-pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ smallvec = "0.6"
trace-time = { path = "../trace-time", version = "0.1" }

[dev-dependencies]
ethereum-types = { version = "0.7", path = "../ethereum-types" }
ethereum-types = { version = "0.8", path = "../ethereum-types" }
2 changes: 1 addition & 1 deletion triehash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ rlp = { version = "0.4", path = "../rlp" }
[dev-dependencies]
criterion = "0.3"
keccak-hasher = "0.15"
ethereum-types = { version = "0.8", path = "../ethereum-types" }
tiny-keccak = "1.5"
trie-standardmap = "0.15"
hex-literal = "0.2"
ethereum-types = { version = "0.7", path = "../ethereum-types" }

[[bench]]
name = "triehash"
Expand Down