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

@@ -9,11 +9,12 @@ use eth2::lighthouse_vc::{
};
use itertools::Itertools;
use lighthouse_validator_store::DEFAULT_GAS_LIMIT;
use rand::{rngs::SmallRng, Rng, SeedableRng};
use rand::rngs::StdRng;
use rand::{Rng, SeedableRng};
use slashing_protection::interchange::{Interchange, InterchangeMetadata};
use std::{collections::HashMap, path::Path};
use tokio::runtime::Handle;
use types::{attestation::AttestationBase, Address};
use types::{Address, attestation::AttestationBase};
use validator_store::ValidatorStore;
use zeroize::Zeroizing;
@@ -1124,11 +1125,14 @@ async fn generic_migration_test(
delete_indices.len()
);
for &i in &delete_indices {
assert!(delete_res
.slashing_protection
.data
.iter()
.any(|interchange_data| interchange_data.pubkey == keystore_pubkey(&keystores[i])));
assert!(
delete_res
.slashing_protection
.data
.iter()
.any(|interchange_data| interchange_data.pubkey
== keystore_pubkey(&keystores[i]))
);
}
// Filter slashing protection according to `slashing_protection_indices`.
@@ -1324,13 +1328,13 @@ async fn delete_concurrent_with_signing() {
let all_pubkeys = all_pubkeys.clone();
let handle = handle.spawn(async move {
let mut rng = SmallRng::from_entropy();
let mut rng: StdRng = SeedableRng::from_os_rng();
let mut slashing_protection = vec![];
for _ in 0..num_delete_attempts {
let to_delete = all_pubkeys
.iter()
.filter(|_| rng.gen_bool(delete_prob))
.filter(|_| rng.random_bool(delete_prob))
.copied()
.collect::<Vec<_>>();