mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 13:58:28 +00:00
Implement get_block_roots for syncing
This commit is contained in:
@@ -8,7 +8,7 @@ use beacon_chain::{
|
||||
CheckPoint,
|
||||
};
|
||||
use eth2_libp2p::HelloMessage;
|
||||
use types::{Epoch, Hash256, Slot};
|
||||
use types::{BeaconStateError, Epoch, Hash256, Slot};
|
||||
|
||||
/// The network's API to the beacon chain.
|
||||
pub trait BeaconChain: Send + Sync {
|
||||
@@ -29,6 +29,12 @@ pub trait BeaconChain: Send + Sync {
|
||||
fn finalized_epoch(&self) -> Epoch;
|
||||
|
||||
fn hello_message(&self) -> HelloMessage;
|
||||
|
||||
fn get_block_roots(
|
||||
&self,
|
||||
start_slot: Slot,
|
||||
count: Slot,
|
||||
) -> Result<Vec<Hash256>, BeaconStateError>;
|
||||
}
|
||||
|
||||
impl<T, U, F> BeaconChain for RawBeaconChain<T, U, F>
|
||||
@@ -81,4 +87,12 @@ where
|
||||
best_slot: self.best_slot(),
|
||||
}
|
||||
}
|
||||
|
||||
fn get_block_roots(
|
||||
&self,
|
||||
start_slot: Slot,
|
||||
count: Slot,
|
||||
) -> Result<Vec<Hash256>, BeaconStateError> {
|
||||
self.get_block_roots(start_slot, count)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user