From 831efba0ceec0778301277f4f6dd44f562d19031 Mon Sep 17 00:00:00 2001 From: Qinxuan Chen Date: Fri, 22 Oct 2021 18:09:02 +0800 Subject: [PATCH] core/: Update libsecp256k1 from 0.6 to 0.7 (#2306) Signed-off-by: koushiro --- core/Cargo.toml | 5 +++-- core/src/identity/rsa.rs | 2 +- core/tests/concurrent_dialing.rs | 2 +- core/tests/connection_limits.rs | 7 +++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/Cargo.toml b/core/Cargo.toml index 98b5077c..18a0a90b 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -18,7 +18,7 @@ fnv = "1.0" futures = { version = "0.3.1", features = ["executor", "thread-pool"] } futures-timer = "3" lazy_static = "1.2" -libsecp256k1 = { version = "0.6.0", optional = true } +libsecp256k1 = { version = "0.7.0", optional = true } log = "0.4" multiaddr = { version = "0.13.0" } multihash = { version = "0.14", default-features = false, features = ["std", "multihash-impl", "identity", "sha2"] } @@ -26,7 +26,7 @@ multistream-select = { version = "0.10", path = "../misc/multistream-select" } parking_lot = "0.11.0" pin-project = "1.0.0" prost = "0.9" -rand = "0.7" +rand = "0.8" rw-stream-sink = "0.2.0" sha2 = "0.9.1" smallvec = "1.6.1" @@ -47,6 +47,7 @@ libp2p-noise = { path = "../transports/noise" } libp2p-tcp = { path = "../transports/tcp" } multihash = { version = "0.14", default-features = false, features = ["arb"] } quickcheck = "0.9.0" +rand07 = { package = "rand", version = "0.7" } wasm-timer = "0.2" [build-dependencies] diff --git a/core/src/identity/rsa.rs b/core/src/identity/rsa.rs index cd18f6a8..97e8f23c 100644 --- a/core/src/identity/rsa.rs +++ b/core/src/identity/rsa.rs @@ -298,7 +298,7 @@ impl DerDecodable<'_> for Asn1SubjectPublicKeyInfo { mod tests { use super::*; use quickcheck::*; - use rand::seq::SliceRandom; + use rand07::seq::SliceRandom; use std::fmt; const KEY1: &'static [u8] = include_bytes!("test/rsa-2048.pk8"); diff --git a/core/tests/concurrent_dialing.rs b/core/tests/concurrent_dialing.rs index 1948b201..08b1b578 100644 --- a/core/tests/concurrent_dialing.rs +++ b/core/tests/concurrent_dialing.rs @@ -29,7 +29,7 @@ use libp2p_core::{ ConnectedPoint, }; use quickcheck::*; -use rand::Rng; +use rand07::Rng; use std::num::NonZeroU8; use std::task::Poll; use util::{test_network, TestHandler}; diff --git a/core/tests/connection_limits.rs b/core/tests/connection_limits.rs index 74388d83..bee42b53 100644 --- a/core/tests/connection_limits.rs +++ b/core/tests/connection_limits.rs @@ -28,13 +28,14 @@ use libp2p_core::{ PeerId, }; use quickcheck::*; -use rand::Rng; use std::task::Poll; use util::{test_network, TestHandler}; #[test] fn max_outgoing() { - let outgoing_limit = rand::thread_rng().gen_range(1, 10); + use rand::Rng; + + let outgoing_limit = rand::thread_rng().gen_range(1..10); let limits = ConnectionLimits::default().with_max_pending_outgoing(Some(outgoing_limit)); let cfg = NetworkConfig::default().with_connection_limits(limits); @@ -89,6 +90,8 @@ fn max_outgoing() { #[test] fn max_established_incoming() { + use rand07::Rng; + #[derive(Debug, Clone)] struct Limit(u32);