diff --git a/Cargo.lock b/Cargo.lock index 3a0ce57790..e3261156b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10131,7 +10131,7 @@ dependencies = [ "futures 0.3.30", "hex", "parking_lot 0.12.1", - "rand 0.8.5", + "rand 0.7.3", "rand_core 0.6.4", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 3629e04b9e..3ad5d5a035 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -463,6 +463,7 @@ proptest = "1.0.0" proptest-derive = "0.3.0" quote = "1.0.16" rand = "0.8.5" +rand_0_7_3 = { package = "rand", version = "0.7.3" } rand_core = { version = "0.6.3", default-features = false } rayon = "1.6.1" regex = "1.6.0" diff --git a/account/Cargo.toml b/account/Cargo.toml index 6961742487..463f556754 100644 --- a/account/Cargo.toml +++ b/account/Cargo.toml @@ -4,7 +4,7 @@ async-trait = { workspace = true } bcs-ext = { workspace = true } futures = { workspace = true } parking_lot = { workspace = true } -rand = { workspace = true } +rand_0_7_3 = { workspace = true } rand_core = { default-features = false, workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/account/src/account_manager.rs b/account/src/account_manager.rs index 7833c71e0d..9785c895a5 100644 --- a/account/src/account_manager.rs +++ b/account/src/account_manager.rs @@ -5,7 +5,7 @@ use crate::account::Account; use crate::account_storage::AccountStorage; use anyhow::format_err; use parking_lot::RwLock; -use rand::prelude::*; +use rand_0_7_3::{prelude::StdRng, rngs, Rng, SeedableRng}; use starcoin_account_api::error::AccountError; use starcoin_account_api::{AccountInfo, AccountPrivateKey, AccountPublicKey, AccountResult}; use starcoin_crypto::ed25519::Ed25519PrivateKey; @@ -354,7 +354,7 @@ impl AccountManager { } pub(crate) fn gen_private_key() -> Ed25519PrivateKey { - let mut seed_rng = rand::rngs::OsRng; + let mut seed_rng = rngs::OsRng; let seed_buf: [u8; 32] = seed_rng.gen(); let mut rng: StdRng = SeedableRng::from_seed(seed_buf); Ed25519PrivateKey::generate(&mut rng)