diff --git a/beacon_node/beacon_chain/src/attestation_processing.rs b/beacon_node/beacon_chain/src/attestation_processing.rs index bc7e2cda1..4470c3d22 100644 --- a/beacon_node/beacon_chain/src/attestation_processing.rs +++ b/beacon_node/beacon_chain/src/attestation_processing.rs @@ -1,13 +1,11 @@ use super::{BeaconChain, ClientDB, SlotClock}; pub use crate::attestation_aggregator::{Error as AggregatorError, ProcessOutcome}; -use crate::canonical_head::Error as HeadError; use types::FreeAttestation; #[derive(Debug, PartialEq)] pub enum Error { - PresentSlotUnknown, + /// The free attestation was not processed succesfully. AggregatorError(AggregatorError), - HeadError(HeadError), } impl BeaconChain @@ -15,6 +13,10 @@ where T: ClientDB, U: SlotClock, { + /// Validate a `FreeAttestation` and either: + /// + /// - Create a new `Attestation`. + /// - Aggregate it to an existing `Attestation`. pub fn process_free_attestation( &self, free_attestation: FreeAttestation, @@ -31,9 +33,3 @@ impl From for Error { Error::AggregatorError(e) } } - -impl From for Error { - fn from(e: HeadError) -> Error { - Error::HeadError(e) - } -}