mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 10:52:43 +00:00
Refactor winning root logic
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
use types::*;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum WinningRootError {
|
||||
NoWinningRoot,
|
||||
BeaconStateError(BeaconStateError),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum EpochProcessingError {
|
||||
UnableToDetermineProducer,
|
||||
@@ -14,7 +8,6 @@ pub enum EpochProcessingError {
|
||||
NoRandaoSeed,
|
||||
BeaconStateError(BeaconStateError),
|
||||
InclusionError(InclusionError),
|
||||
WinningRootError(WinningRootError),
|
||||
}
|
||||
|
||||
impl From<InclusionError> for EpochProcessingError {
|
||||
@@ -29,8 +22,15 @@ impl From<BeaconStateError> for EpochProcessingError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BeaconStateError> for WinningRootError {
|
||||
fn from(e: BeaconStateError) -> WinningRootError {
|
||||
WinningRootError::BeaconStateError(e)
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum InclusionError {
|
||||
/// The validator did not participate in an attestation in this period.
|
||||
NoAttestationsForValidator,
|
||||
BeaconStateError(BeaconStateError),
|
||||
}
|
||||
|
||||
impl From<BeaconStateError> for InclusionError {
|
||||
fn from(e: BeaconStateError) -> InclusionError {
|
||||
InclusionError::BeaconStateError(e)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user