mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 13:54:44 +00:00
Rust 1.84 lints (#6781)
* Fix few lints * Fix remaining lints * Use fully qualified syntax
This commit is contained in:
@@ -53,7 +53,7 @@ pub fn initialize_beacon_state_from_eth1<E: EthSpec>(
|
||||
// https://github.com/ethereum/eth2.0-specs/pull/2323
|
||||
if spec
|
||||
.altair_fork_epoch
|
||||
.map_or(false, |fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
.is_some_and(|fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
{
|
||||
upgrade_to_altair(&mut state, spec)?;
|
||||
|
||||
@@ -63,7 +63,7 @@ pub fn initialize_beacon_state_from_eth1<E: EthSpec>(
|
||||
// Similarly, perform an upgrade to the merge if configured from genesis.
|
||||
if spec
|
||||
.bellatrix_fork_epoch
|
||||
.map_or(false, |fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
.is_some_and(|fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
{
|
||||
// this will set state.latest_execution_payload_header = ExecutionPayloadHeaderBellatrix::default()
|
||||
upgrade_to_bellatrix(&mut state, spec)?;
|
||||
@@ -81,7 +81,7 @@ pub fn initialize_beacon_state_from_eth1<E: EthSpec>(
|
||||
// Upgrade to capella if configured from genesis
|
||||
if spec
|
||||
.capella_fork_epoch
|
||||
.map_or(false, |fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
.is_some_and(|fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
{
|
||||
upgrade_to_capella(&mut state, spec)?;
|
||||
|
||||
@@ -98,7 +98,7 @@ pub fn initialize_beacon_state_from_eth1<E: EthSpec>(
|
||||
// Upgrade to deneb if configured from genesis
|
||||
if spec
|
||||
.deneb_fork_epoch
|
||||
.map_or(false, |fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
.is_some_and(|fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
{
|
||||
upgrade_to_deneb(&mut state, spec)?;
|
||||
|
||||
@@ -115,7 +115,7 @@ pub fn initialize_beacon_state_from_eth1<E: EthSpec>(
|
||||
// Upgrade to electra if configured from genesis.
|
||||
if spec
|
||||
.electra_fork_epoch
|
||||
.map_or(false, |fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
.is_some_and(|fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
{
|
||||
let post = upgrade_state_to_electra(&mut state, Epoch::new(0), Epoch::new(0), spec)?;
|
||||
state = post;
|
||||
@@ -153,7 +153,7 @@ pub fn initialize_beacon_state_from_eth1<E: EthSpec>(
|
||||
pub fn is_valid_genesis_state<E: EthSpec>(state: &BeaconState<E>, spec: &ChainSpec) -> bool {
|
||||
state
|
||||
.get_active_validator_indices(E::genesis_epoch(), spec)
|
||||
.map_or(false, |active_validators| {
|
||||
.is_ok_and(|active_validators| {
|
||||
state.genesis_time() >= spec.min_genesis_time
|
||||
&& active_validators.len() as u64 >= spec.min_genesis_active_validator_count
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user