mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 21:34:46 +00:00
Address clippy lints in tree-states (#4414)
* Address some clippy lints * Box errors to fix error size lint * Add Default impl for Validator * Address more clippy lints * Re-implement `check_state_diff` * Fix misc test compile errors
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
#![cfg(test)]
|
||||
use crate::{test_utils::*, ForkName};
|
||||
use beacon_chain::test_utils::{
|
||||
interop_genesis_state_with_eth1, test_spec, BeaconChainHarness, EphemeralHarnessType,
|
||||
DEFAULT_ETH1_BLOCK_HASH,
|
||||
};
|
||||
use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType};
|
||||
use beacon_chain::types::{
|
||||
test_utils::TestRandom, BeaconState, BeaconStateAltair, BeaconStateBase, BeaconStateError,
|
||||
BeaconStateMerge, ChainSpec, Domain, Epoch, EthSpec, FixedVector, Hash256, Keypair,
|
||||
MainnetEthSpec, MinimalEthSpec, RelativeEpoch, Slot,
|
||||
test_utils::TestRandom, BeaconState, BeaconStateAltair, BeaconStateBase, BeaconStateCapella,
|
||||
BeaconStateError, BeaconStateMerge, ChainSpec, Domain, Epoch, EthSpec, FixedVector, Hash256,
|
||||
Keypair, MainnetEthSpec, MinimalEthSpec, RelativeEpoch, Slot,
|
||||
};
|
||||
use ssz::Encode;
|
||||
use std::ops::Mul;
|
||||
@@ -418,6 +415,7 @@ fn check_num_fields_pow2() {
|
||||
ForkName::Base => BeaconStateBase::<E>::NUM_FIELDS,
|
||||
ForkName::Altair => BeaconStateAltair::<E>::NUM_FIELDS,
|
||||
ForkName::Merge => BeaconStateMerge::<E>::NUM_FIELDS,
|
||||
ForkName::Capella => BeaconStateCapella::<E>::NUM_FIELDS,
|
||||
};
|
||||
assert_eq!(
|
||||
num_fields.next_power_of_two(),
|
||||
|
||||
@@ -230,7 +230,15 @@ impl Validator {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
impl Default for Validator {
|
||||
fn default() -> Self {
|
||||
Validator {
|
||||
pubkey: Arc::new(PublicKeyBytes::empty()),
|
||||
mutable: <_>::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ValidatorMutable {
|
||||
fn default() -> Self {
|
||||
ValidatorMutable {
|
||||
@@ -244,7 +252,6 @@ impl Default for ValidatorMutable {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
impl TreeHash for Validator {
|
||||
fn tree_hash_type() -> tree_hash::TreeHashType {
|
||||
|
||||
Reference in New Issue
Block a user