Correct process_attestation error handling.

This commit is contained in:
Grant Wuerker
2019-07-24 18:03:48 +02:00
parent b2471eca49
commit 51645aa9af
4 changed files with 41 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ use crate::metrics::Error as MetricsError;
use state_processing::BlockProcessingError;
use state_processing::SlotProcessingError;
use types::*;
use state_processing::per_block_processing::errors::{AttestationValidationError, IndexedAttestationValidationError};
macro_rules! easy_from_to {
($from: ident, $to: ident) => {
@@ -31,6 +32,8 @@ pub enum BeaconChainError {
MissingBeaconState(Hash256),
SlotProcessingError(SlotProcessingError),
MetricsError(String),
AttestationValidationError(AttestationValidationError),
IndexedAttestationValidationError(IndexedAttestationValidationError)
}
easy_from_to!(SlotProcessingError, BeaconChainError);
@@ -53,3 +56,5 @@ pub enum BlockProductionError {
easy_from_to!(BlockProcessingError, BlockProductionError);
easy_from_to!(BeaconStateError, BlockProductionError);
easy_from_to!(SlotProcessingError, BlockProductionError);
easy_from_to!(AttestationValidationError, BeaconChainError);
easy_from_to!(IndexedAttestationValidationError, BeaconChainError);