Update Rust Edition to 2024 (#7766)

* #7749

Thanks @dknopik and @michaelsproul for your help!
This commit is contained in:
chonghe
2025-08-13 11:04:31 +08:00
committed by GitHub
parent bd6b8b6a65
commit 522bd9e9c6
468 changed files with 3594 additions and 3396 deletions

View File

@@ -1,17 +1,17 @@
use crate::{
KeyType, ValidatorPath,
json_wallet::{
Aes128Ctr, ChecksumModule, Cipher, CipherModule, Crypto, EmptyMap, EmptyString, JsonWallet,
Kdf, KdfModule, Sha256Checksum, TypeField, Version,
},
KeyType, ValidatorPath,
};
pub use bip39::{Mnemonic, Seed as Bip39Seed};
pub use eth2_key_derivation::{DerivedKey, DerivedKeyError};
use eth2_keystore::{
decrypt, default_kdf, encrypt, keypair_from_secret, Keystore, KeystoreBuilder, IV_SIZE,
SALT_SIZE,
};
pub use eth2_keystore::{Error as KeystoreError, PlainText};
use eth2_keystore::{
IV_SIZE, Keystore, KeystoreBuilder, SALT_SIZE, decrypt, default_kdf, encrypt,
keypair_from_secret,
};
use rand::prelude::*;
use serde::{Deserialize, Serialize};
use std::io::{Read, Write};
@@ -90,8 +90,8 @@ impl<'a> WalletBuilder<'a> {
} else if seed.is_empty() {
Err(Error::EmptySeed)
} else {
let salt = rand::thread_rng().gen::<[u8; SALT_SIZE]>();
let iv = rand::thread_rng().gen::<[u8; IV_SIZE]>().to_vec().into();
let salt = rand::rng().random::<[u8; SALT_SIZE]>();
let iv = rand::rng().random::<[u8; IV_SIZE]>().to_vec().into();
Ok(Self {
seed: seed.to_vec().into(),