mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-13 21:20:52 +00:00
Fix clippy warnings (#813)
* Clippy account manager * Clippy account_manager * Clippy beacon_node/beacon_chain * Clippy beacon_node/client * Clippy beacon_node/eth1 * Clippy beacon_node/eth2-libp2p * Clippy beacon_node/genesis * Clippy beacon_node/network * Clippy beacon_node/rest_api * Clippy beacon_node/src * Clippy beacon_node/store * Clippy eth2/lmd_ghost * Clippy eth2/operation_pool * Clippy eth2/state_processing * Clippy eth2/types * Clippy eth2/utils/bls * Clippy eth2/utils/cahced_tree_hash * Clippy eth2/utils/deposit_contract * Clippy eth2/utils/eth2_interop_keypairs * Clippy eth2/utils/eth2_testnet_config * Clippy eth2/utils/lighthouse_metrics * Clippy eth2/utils/ssz * Clippy eth2/utils/ssz_types * Clippy eth2/utils/tree_hash_derive * Clippy lcli * Clippy tests/beacon_chain_sim * Clippy validator_client * Cargo fmt
This commit is contained in:
@@ -145,14 +145,15 @@ impl<E: EthSpec> Store<E> for HotColdDB<E> {
|
||||
let current_split_slot = store.get_split_slot();
|
||||
|
||||
if frozen_head.slot < current_split_slot {
|
||||
Err(HotColdDBError::FreezeSlotError {
|
||||
return Err(HotColdDBError::FreezeSlotError {
|
||||
current_split_slot,
|
||||
proposed_split_slot: frozen_head.slot,
|
||||
})?;
|
||||
}
|
||||
.into());
|
||||
}
|
||||
|
||||
if frozen_head.slot % E::slots_per_epoch() != 0 {
|
||||
Err(HotColdDBError::FreezeSlotUnaligned(frozen_head.slot))?;
|
||||
return Err(HotColdDBError::FreezeSlotUnaligned(frozen_head.slot).into());
|
||||
}
|
||||
|
||||
// 1. Copy all of the states between the head and the split slot, from the hot DB
|
||||
@@ -574,7 +575,7 @@ impl<E: EthSpec> HotColdDB<E> {
|
||||
let key = Self::restore_point_key(restore_point_index);
|
||||
RestorePointHash::db_get(&self.cold_db, &key)?
|
||||
.map(|r| r.state_root)
|
||||
.ok_or(HotColdDBError::MissingRestorePointHash(restore_point_index).into())
|
||||
.ok_or_else(|| HotColdDBError::MissingRestorePointHash(restore_point_index).into())
|
||||
}
|
||||
|
||||
/// Store the state root of a restore point.
|
||||
|
||||
Reference in New Issue
Block a user