mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 05:18:30 +00:00
Update Rust Edition to 2024 (#7766)
* #7749 Thanks @dknopik and @michaelsproul for your help!
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
use crate::{Error as DirError, ValidatorDir};
|
||||
use bls::get_withdrawal_credentials;
|
||||
use deposit_contract::{encode_eth1_tx_data, Error as DepositError};
|
||||
use deposit_contract::{Error as DepositError, encode_eth1_tx_data};
|
||||
use eth2_keystore::{Error as KeystoreError, Keystore, KeystoreBuilder, PlainText};
|
||||
use filesystem::create_with_600_perms;
|
||||
use rand::{distributions::Alphanumeric, Rng};
|
||||
use std::fs::{create_dir_all, File};
|
||||
use rand::{Rng, distr::Alphanumeric};
|
||||
use std::fs::{File, create_dir_all};
|
||||
use std::io::{self, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
use types::{ChainSpec, DepositData, Hash256, Keypair, Signature};
|
||||
@@ -314,7 +314,7 @@ pub fn write_password_to_file<P: AsRef<Path>>(path: P, bytes: &[u8]) -> Result<(
|
||||
/// Generates a random keystore with a random password.
|
||||
fn random_keystore() -> Result<(Keystore, PlainText), Error> {
|
||||
let keypair = Keypair::random();
|
||||
let password: PlainText = rand::thread_rng()
|
||||
let password: PlainText = rand::rng()
|
||||
.sample_iter(&Alphanumeric)
|
||||
.take(DEFAULT_PASSWORD_LEN)
|
||||
.map(char::from)
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
use crate::{Builder, BuilderError};
|
||||
use eth2_keystore::{
|
||||
DKLEN, Keystore, KeystoreBuilder, PlainText,
|
||||
json_keystore::{Kdf, Scrypt},
|
||||
Keystore, KeystoreBuilder, PlainText, DKLEN,
|
||||
};
|
||||
use std::path::PathBuf;
|
||||
use types::test_utils::generate_deterministic_keypair;
|
||||
|
||||
@@ -11,10 +11,10 @@ pub mod insecure_keys;
|
||||
mod validator_dir;
|
||||
|
||||
pub use crate::validator_dir::{
|
||||
unlock_keypair_from_password_path, Error, Eth1DepositData, ValidatorDir,
|
||||
ETH1_DEPOSIT_TX_HASH_FILE,
|
||||
ETH1_DEPOSIT_TX_HASH_FILE, Error, Eth1DepositData, ValidatorDir,
|
||||
unlock_keypair_from_password_path,
|
||||
};
|
||||
pub use builder::{
|
||||
keystore_password_path, Builder, Error as BuilderError, ETH1_DEPOSIT_DATA_FILE,
|
||||
VOTING_KEYSTORE_FILE, WITHDRAWAL_KEYSTORE_FILE,
|
||||
Builder, ETH1_DEPOSIT_DATA_FILE, Error as BuilderError, VOTING_KEYSTORE_FILE,
|
||||
WITHDRAWAL_KEYSTORE_FILE, keystore_password_path,
|
||||
};
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use crate::builder::{
|
||||
keystore_password_path, ETH1_DEPOSIT_AMOUNT_FILE, ETH1_DEPOSIT_DATA_FILE, VOTING_KEYSTORE_FILE,
|
||||
WITHDRAWAL_KEYSTORE_FILE,
|
||||
ETH1_DEPOSIT_AMOUNT_FILE, ETH1_DEPOSIT_DATA_FILE, VOTING_KEYSTORE_FILE,
|
||||
WITHDRAWAL_KEYSTORE_FILE, keystore_password_path,
|
||||
};
|
||||
use deposit_contract::decode_eth1_tx_data;
|
||||
use derivative::Derivative;
|
||||
use eth2_keystore::{Error as KeystoreError, Keystore, PlainText};
|
||||
use lockfile::{Lockfile, LockfileError};
|
||||
use std::fs::{read, write, File};
|
||||
use std::fs::{File, read, write};
|
||||
use std::io;
|
||||
use std::path::{Path, PathBuf};
|
||||
use tree_hash::TreeHash;
|
||||
|
||||
Reference in New Issue
Block a user