lighthouse/eth2/state_processing/src/errors.rs

31 lines
753 B
Rust
Raw Normal View History

use types::BeaconStateError;
#[derive(Debug, PartialEq)]
pub enum AttestationValidationError {
Invalid(AttestationInvalid),
ProcessingError(BeaconStateError),
}
#[derive(Debug, PartialEq)]
pub enum AttestationInvalid {
PreGenesis,
IncludedTooEarly,
IncludedTooLate,
WrongJustifiedSlot,
WrongJustifiedRoot,
BadLatestCrosslinkRoot,
CustodyBitfieldHasSetBits,
AggregationBitfieldIsEmpty,
BadAggregationBitfieldLength,
BadCustodyBitfieldLength,
NoCommitteeForShard,
BadSignature,
ShardBlockRootNotZero,
}
impl From<BeaconStateError> for AttestationValidationError {
fn from(e: BeaconStateError) -> AttestationValidationError {
AttestationValidationError::ProcessingError(e)
}
}