mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
Implements hello generation in sync module
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user