mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Update Rust Edition to 2024 (#7766)
* #7749 Thanks @dknopik and @michaelsproul for your help!
This commit is contained in:
@@ -4,8 +4,8 @@ mod wallet;
|
||||
pub mod json_wallet;
|
||||
|
||||
pub use bip39;
|
||||
pub use validator_path::{KeyType, ValidatorPath, COIN_TYPE, PURPOSE};
|
||||
pub use validator_path::{COIN_TYPE, KeyType, PURPOSE, ValidatorPath};
|
||||
pub use wallet::{
|
||||
recover_validator_secret, recover_validator_secret_from_mnemonic, DerivedKey, Error,
|
||||
KeystoreError, PlainText, Uuid, ValidatorKeystores, Wallet, WalletBuilder,
|
||||
DerivedKey, Error, KeystoreError, PlainText, Uuid, ValidatorKeystores, Wallet, WalletBuilder,
|
||||
recover_validator_secret, recover_validator_secret_from_mnemonic,
|
||||
};
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#![cfg(not(debug_assertions))]
|
||||
|
||||
use eth2_wallet::{
|
||||
DerivedKey, Error, KeyType, KeystoreError, Wallet, WalletBuilder,
|
||||
bip39::{Language, Mnemonic, Seed},
|
||||
recover_validator_secret, DerivedKey, Error, KeyType, KeystoreError, Wallet, WalletBuilder,
|
||||
recover_validator_secret,
|
||||
};
|
||||
use std::fs::File;
|
||||
use tempfile::tempdir;
|
||||
|
||||
Reference in New Issue
Block a user