mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 11:52:42 +00:00
Satisfy Clippy, remove non-tree-states code
This commit is contained in:
@@ -72,7 +72,6 @@ pub enum BlockProcessingError {
|
||||
},
|
||||
ExecutionInvalid,
|
||||
ConsensusContext(ContextError),
|
||||
#[cfg(feature = "milhouse")]
|
||||
MilhouseError(milhouse::Error),
|
||||
}
|
||||
|
||||
@@ -112,7 +111,6 @@ impl From<ContextError> for BlockProcessingError {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "milhouse")]
|
||||
impl From<milhouse::Error> for BlockProcessingError {
|
||||
fn from(e: milhouse::Error) -> Self {
|
||||
Self::MilhouseError(e)
|
||||
|
||||
@@ -7,8 +7,8 @@ use crate::per_block_processing::errors::{
|
||||
ProposerSlashingInvalid,
|
||||
};
|
||||
use crate::{
|
||||
per_block_processing::process_operations, BlockSignatureStrategy, VerifyBlockRoot,
|
||||
VerifySignatures,
|
||||
per_block_processing::process_operations, BlockSignatureStrategy, ConsensusContext,
|
||||
VerifyBlockRoot, VerifySignatures,
|
||||
};
|
||||
use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType};
|
||||
use lazy_static::lazy_static;
|
||||
@@ -63,12 +63,13 @@ fn valid_block_ok() {
|
||||
let slot = state.slot();
|
||||
let (block, mut state) = harness.make_block_return_pre_state(state, slot + Slot::new(1));
|
||||
|
||||
let mut ctxt = ConsensusContext::new(block.slot());
|
||||
let result = per_block_processing(
|
||||
&mut state,
|
||||
&block,
|
||||
None,
|
||||
BlockSignatureStrategy::VerifyIndividual,
|
||||
VerifyBlockRoot::True,
|
||||
&mut ctxt,
|
||||
&spec,
|
||||
);
|
||||
|
||||
@@ -87,12 +88,13 @@ fn invalid_block_header_state_slot() {
|
||||
let (mut block, signature) = signed_block.deconstruct();
|
||||
*block.slot_mut() = slot + Slot::new(1);
|
||||
|
||||
let mut ctxt = ConsensusContext::new(block.slot());
|
||||
let result = per_block_processing(
|
||||
&mut state,
|
||||
&SignedBeaconBlock::from_block(block, signature),
|
||||
None,
|
||||
BlockSignatureStrategy::VerifyIndividual,
|
||||
VerifyBlockRoot::True,
|
||||
&mut ctxt,
|
||||
&spec,
|
||||
);
|
||||
|
||||
@@ -116,12 +118,13 @@ fn invalid_parent_block_root() {
|
||||
let (mut block, signature) = signed_block.deconstruct();
|
||||
*block.parent_root_mut() = Hash256::from([0xAA; 32]);
|
||||
|
||||
let mut ctxt = ConsensusContext::new(block.slot());
|
||||
let result = per_block_processing(
|
||||
&mut state,
|
||||
&SignedBeaconBlock::from_block(block, signature),
|
||||
None,
|
||||
BlockSignatureStrategy::VerifyIndividual,
|
||||
VerifyBlockRoot::True,
|
||||
&mut ctxt,
|
||||
&spec,
|
||||
);
|
||||
|
||||
@@ -146,12 +149,13 @@ fn invalid_block_signature() {
|
||||
let (signed_block, mut state) = harness.make_block_return_pre_state(state, slot + Slot::new(1));
|
||||
let (block, _) = signed_block.deconstruct();
|
||||
|
||||
let mut ctxt = ConsensusContext::new(block.slot());
|
||||
let result = per_block_processing(
|
||||
&mut state,
|
||||
&SignedBeaconBlock::from_block(block, Signature::empty()),
|
||||
None,
|
||||
BlockSignatureStrategy::VerifyIndividual,
|
||||
VerifyBlockRoot::True,
|
||||
&mut ctxt,
|
||||
&spec,
|
||||
);
|
||||
|
||||
@@ -176,12 +180,13 @@ fn invalid_randao_reveal_signature() {
|
||||
*block.body_mut().randao_reveal_mut() = Signature::empty();
|
||||
});
|
||||
|
||||
let mut ctxt = ConsensusContext::new(signed_block.slot());
|
||||
let result = per_block_processing(
|
||||
&mut state,
|
||||
&signed_block,
|
||||
None,
|
||||
BlockSignatureStrategy::VerifyIndividual,
|
||||
VerifyBlockRoot::True,
|
||||
&mut ctxt,
|
||||
&spec,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user