Update state_processing

This commit is contained in:
Michael Sproul
2021-11-25 17:32:18 +11:00
parent 1b4dad0d76
commit 238ac98d7c
18 changed files with 107 additions and 20 deletions

View File

@@ -57,6 +57,8 @@ pub enum BlockProcessingError {
ArithError(ArithError),
InconsistentBlockFork(InconsistentFork),
InconsistentStateFork(InconsistentFork),
#[cfg(feature = "milhouse")]
MilhouseError(milhouse::Error),
}
impl From<BeaconStateError> for BlockProcessingError {
@@ -89,6 +91,13 @@ impl From<SyncAggregateInvalid> for BlockProcessingError {
}
}
#[cfg(feature = "milhouse")]
impl From<milhouse::Error> for BlockProcessingError {
fn from(e: milhouse::Error) -> Self {
Self::MilhouseError(e)
}
}
impl From<BlockOperationError<HeaderInvalid>> for BlockProcessingError {
fn from(e: BlockOperationError<HeaderInvalid>) -> BlockProcessingError {
match e {

View File

@@ -14,6 +14,9 @@ use types::{
SignedVoluntaryExit, SigningData, Slot, SyncAggregate, SyncAggregatorSelectionData, Unsigned,
};
#[cfg(feature = "milhouse")]
use types::milhouse::prelude::*;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, PartialEq, Clone)]