use beacon_chain::BeaconChain as RawBeaconChain; use beacon_chain::{ db::ClientDB, fork_choice::ForkChoice, parking_lot::RwLockReadGuard, slot_clock::SlotClock, types::{BeaconState, ChainSpec}, }; pub use beacon_chain::{BeaconChainError, BlockProcessingOutcome}; use types::BeaconBlock; /// The RPC's API to the beacon chain. pub trait BeaconChain: Send + Sync { fn get_spec(&self) -> &ChainSpec; fn get_state(&self) -> RwLockReadGuard; fn process_block(&self, block: BeaconBlock) -> Result; } impl BeaconChain for RawBeaconChain where T: ClientDB + Sized, U: SlotClock, F: ForkChoice, { fn get_spec(&self) -> &ChainSpec { &self.spec } fn get_state(&self) -> RwLockReadGuard { self.state.read() } fn process_block( &self, block: BeaconBlock, ) -> Result { self.process_block(block) } }