Implements hello generation in sync module

This commit is contained in:
Age Manning
2019-03-19 00:26:15 +11:00
parent 41abdb7599
commit dfdec78a7a
2 changed files with 32 additions and 2 deletions

View File

@@ -1,13 +1,19 @@
use beacon_chain::BeaconChain as RawBeaconChain;
use beacon_chain::{
db::ClientDB, fork_choice::ForkChoice, parking_lot::RwLockReadGuard, slot_clock::SlotClock,
types::ChainSpec, CheckPoint,
db::ClientDB,
fork_choice::ForkChoice,
parking_lot::RwLockReadGuard,
slot_clock::SlotClock,
types::{BeaconState, ChainSpec},
CheckPoint,
};
/// The network's API to the beacon chain.
pub trait BeaconChain: Send + Sync {
fn get_spec(&self) -> &ChainSpec;
fn get_state(&self) -> RwLockReadGuard<BeaconState>;
fn head(&self) -> RwLockReadGuard<CheckPoint>;
fn finalized_head(&self) -> RwLockReadGuard<CheckPoint>;
@@ -23,6 +29,10 @@ where
&self.spec
}
fn get_state(&self) -> RwLockReadGuard<BeaconState> {
self.state.read()
}
fn head(&self) -> RwLockReadGuard<CheckPoint> {
self.head()
}