-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(deps): Bump rand to 0.8 and quickcheck to 1 (#2857)
Co-authored-by: Thomas Eizinger <[email protected]> Co-authored-by: Max Inden <[email protected]>
- Loading branch information
1 parent
a4d1e58
commit e530118
Showing
49 changed files
with
344 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "quickcheck-ext" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
license = "Unlicense/MIT" | ||
|
||
[dependencies] | ||
quickcheck = "1" | ||
num-traits = "0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
pub use quickcheck::*; | ||
|
||
use core::ops::Range; | ||
use num_traits::sign::Unsigned; | ||
|
||
pub trait GenRange { | ||
fn gen_range<T: Unsigned + Arbitrary + Copy>(&mut self, _range: Range<T>) -> T; | ||
|
||
fn gen_index(&mut self, ubound: usize) -> usize { | ||
if ubound <= (core::u32::MAX as usize) { | ||
self.gen_range(0..ubound as u32) as usize | ||
} else { | ||
self.gen_range(0..ubound) | ||
} | ||
} | ||
} | ||
|
||
impl GenRange for Gen { | ||
fn gen_range<T: Unsigned + Arbitrary + Copy>(&mut self, range: Range<T>) -> T { | ||
<T as Arbitrary>::arbitrary(self) % (range.end - range.start) + range.start | ||
} | ||
} | ||
|
||
pub trait SliceRandom { | ||
fn shuffle<T>(&mut self, arr: &mut [T]); | ||
fn choose_multiple<'a, T>( | ||
&mut self, | ||
arr: &'a [T], | ||
amount: usize, | ||
) -> std::iter::Take<std::vec::IntoIter<&'a T>> { | ||
let mut v: Vec<&T> = arr.iter().collect(); | ||
self.shuffle(&mut v); | ||
v.into_iter().take(amount) | ||
} | ||
} | ||
|
||
impl SliceRandom for Gen { | ||
fn shuffle<T>(&mut self, arr: &mut [T]) { | ||
for i in (1..arr.len()).rev() { | ||
// invariant: elements with index > i have been locked in place. | ||
arr.swap(i, self.gen_index(i + 1)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name = "libp2p-mplex" | |
edition = "2021" | ||
rust-version = "1.56.1" | ||
description = "Mplex multiplexing protocol for libp2p" | ||
version = "0.36.0" | ||
version = "0.36.1" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
license = "MIT" | ||
repository = "https://github.com/libp2p/rust-libp2p" | ||
|
@@ -18,7 +18,7 @@ libp2p-core = { version = "0.36.0", path = "../../core", default-features = fals | |
log = "0.4" | ||
nohash-hasher = "0.2" | ||
parking_lot = "0.12" | ||
rand = "0.7" | ||
rand = "0.8" | ||
smallvec = "1.6.1" | ||
unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } | ||
|
||
|
@@ -28,8 +28,7 @@ criterion = "0.4" | |
env_logger = "0.9" | ||
futures = "0.3" | ||
libp2p = { path = "../../", default-features = false, features = ["tcp-async-io", "plaintext", "mplex"] } | ||
quickcheck = "0.9" | ||
rand = "0.7" | ||
quickcheck = { package = "quickcheck-ext", path = "../../misc/quickcheck-ext" } | ||
|
||
[[bench]] | ||
name = "split_send_size" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name = "libp2p-floodsub" | |
edition = "2021" | ||
rust-version = "1.56.1" | ||
description = "Floodsub protocol for libp2p" | ||
version = "0.39.0" | ||
version = "0.39.1" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
license = "MIT" | ||
repository = "https://github.com/libp2p/rust-libp2p" | ||
|
@@ -18,7 +18,7 @@ libp2p-core = { version = "0.36.0", path = "../../core", default-features = fals | |
libp2p-swarm = { version = "0.39.0", path = "../../swarm" } | ||
log = "0.4" | ||
prost = "0.11" | ||
rand = "0.7" | ||
rand = "0.8" | ||
smallvec = "1.6.1" | ||
|
||
[build-dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name = "libp2p-gossipsub" | |
edition = "2021" | ||
rust-version = "1.56.1" | ||
description = "Gossipsub protocol for libp2p" | ||
version = "0.41.0" | ||
version = "0.41.1" | ||
authors = ["Age Manning <[email protected]>"] | ||
license = "MIT" | ||
repository = "https://github.com/libp2p/rust-libp2p" | ||
|
@@ -17,7 +17,7 @@ bytes = "1.0" | |
byteorder = "1.3.4" | ||
fnv = "1.0.7" | ||
futures = "0.3.5" | ||
rand = "0.7.3" | ||
rand = "0.8" | ||
asynchronous-codec = "0.6" | ||
unsigned-varint = { version = "0.7.0", features = ["asynchronous_codec"] } | ||
log = "0.4.11" | ||
|
@@ -37,7 +37,7 @@ prometheus-client = "0.18.0" | |
async-std = "1.6.3" | ||
env_logger = "0.9.0" | ||
libp2p = { path = "../../", default-features = false, features = ["plaintext", "yamux", "noise", "mplex", "gossipsub"] } | ||
quickcheck = "0.9.2" | ||
quickcheck = { package = "quickcheck-ext", path = "../../misc/quickcheck-ext" } | ||
hex = "0.4.2" | ||
derive_builder = "0.11.1" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.