use super::{BeaconChain, ClientDB, SlotClock}; pub use crate::attestation_aggregator::{ProcessError as AggregatorError, ProcessOutcome}; use crate::canonical_head::Error as HeadError; use types::FreeAttestation; #[derive(Debug, PartialEq)] pub enum Error { PresentSlotUnknown, AggregatorError(AggregatorError), HeadError(HeadError), } impl BeaconChain where T: ClientDB, U: SlotClock, { pub fn process_free_attestation( &self, free_attestation: FreeAttestation, ) -> Result { self.attestation_aggregator .write() .process_free_attestation(&self.state.read(), &free_attestation, &self.spec) .map_err(|e| e.into()) } } impl From for Error { fn from(e: AggregatorError) -> Error { Error::AggregatorError(e) } } impl From for Error { fn from(e: HeadError) -> Error { Error::HeadError(e) } }