mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 13:28:33 +00:00
Fix all compile errors from v0.4.0 update
This commit is contained in:
33
beacon_node/beacon_chain/src/errors.rs
Normal file
33
beacon_node/beacon_chain/src/errors.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use fork_choice::ForkChoiceError;
|
||||
use state_processing::BlockProcessingError;
|
||||
use types::*;
|
||||
|
||||
macro_rules! easy_from_to {
|
||||
($from: ident, $to: ident) => {
|
||||
impl From<$from> for $to {
|
||||
fn from(e: $from) -> $to {
|
||||
$to::$from(e)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum BeaconChainError {
|
||||
InsufficientValidators,
|
||||
BadRecentBlockRoots,
|
||||
BeaconStateError(BeaconStateError),
|
||||
DBInconsistent(String),
|
||||
DBError(String),
|
||||
ForkChoiceError(ForkChoiceError),
|
||||
MissingBeaconBlock(Hash256),
|
||||
MissingBeaconState(Hash256),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum BlockProductionError {
|
||||
UnableToGetBlockRootFromState,
|
||||
BlockProcessingError(BlockProcessingError),
|
||||
}
|
||||
|
||||
easy_from_to!(BlockProcessingError, BlockProductionError);
|
||||
Reference in New Issue
Block a user