mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 22:08:30 +00:00
Fix clippy lints
This commit is contained in:
@@ -23,25 +23,31 @@ where
|
||||
.present_slot()?
|
||||
.ok_or(Error::PresentSlotIsNone)?;
|
||||
let parent_root = self.canonical_leaf_block;
|
||||
let parent_block = self
|
||||
let parent_block_reader = self
|
||||
.block_store
|
||||
.get_deserialized(&parent_root)?
|
||||
.ok_or(Error::DBError("Block not found.".to_string()))?;
|
||||
let parent_state = self
|
||||
.get_reader(&parent_root)?
|
||||
.ok_or_else(|| Error::DBError("Block not found.".to_string()))?;
|
||||
let parent_state_reader = self
|
||||
.state_store
|
||||
.get_deserialized(&parent_block.state_root())?
|
||||
.ok_or(Error::DBError("State not found.".to_string()))?;
|
||||
.get_reader(&parent_block_reader.state_root())?
|
||||
.ok_or_else(|| Error::DBError("State not found.".to_string()))?;
|
||||
|
||||
let parent_block = parent_block_reader
|
||||
.into_beacon_block()
|
||||
.ok_or_else(|| Error::DBError("Bad parent block SSZ.".to_string()))?;
|
||||
let mut block = BeaconBlock {
|
||||
slot: present_slot,
|
||||
parent_root,
|
||||
state_root: Hash256::zero(), // Updated after the state is calculated.
|
||||
..parent_block.to_beacon_block()
|
||||
..parent_block
|
||||
};
|
||||
|
||||
let parent_state = parent_state_reader
|
||||
.into_beacon_state()
|
||||
.ok_or_else(|| Error::DBError("Bad parent block SSZ.".to_string()))?;
|
||||
let state = BeaconState {
|
||||
slot: present_slot,
|
||||
..parent_state.to_beacon_state()
|
||||
..parent_state
|
||||
};
|
||||
let state_root = state.canonical_root();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ where
|
||||
block_store.put(&block_root, &ssz_encode(&genesis_block)[..])?;
|
||||
|
||||
let mut leaf_blocks = HashSet::new();
|
||||
leaf_blocks.insert(block_root.clone());
|
||||
leaf_blocks.insert(block_root);
|
||||
|
||||
Ok(Self {
|
||||
block_store,
|
||||
|
||||
@@ -20,6 +20,7 @@ macro_rules! impl_crud_for_store {
|
||||
};
|
||||
}
|
||||
|
||||
#[allow(unused_macros)]
|
||||
macro_rules! test_crud_for_store {
|
||||
($store: ident, $db_column: expr) => {
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user