mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
Implement block imports for sync
This commit is contained in:
@@ -10,7 +10,7 @@ use beacon_chain::{
|
||||
use eth2_libp2p::HelloMessage;
|
||||
use types::{BeaconBlock, BeaconStateError, Epoch, Hash256, Slot};
|
||||
|
||||
pub use beacon_chain::BeaconChainError;
|
||||
pub use beacon_chain::{BeaconChainError, BlockProcessingOutcome};
|
||||
|
||||
/// The network's API to the beacon chain.
|
||||
pub trait BeaconChain: Send + Sync {
|
||||
@@ -34,6 +34,9 @@ pub trait BeaconChain: Send + Sync {
|
||||
|
||||
fn hello_message(&self) -> HelloMessage;
|
||||
|
||||
fn process_block(&self, block: BeaconBlock)
|
||||
-> Result<BlockProcessingOutcome, BeaconChainError>;
|
||||
|
||||
fn get_block_roots(
|
||||
&self,
|
||||
start_slot: Slot,
|
||||
@@ -98,6 +101,13 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn process_block(
|
||||
&self,
|
||||
block: BeaconBlock,
|
||||
) -> Result<BlockProcessingOutcome, BeaconChainError> {
|
||||
self.process_block(block)
|
||||
}
|
||||
|
||||
fn get_block_roots(
|
||||
&self,
|
||||
start_slot: Slot,
|
||||
|
||||
Reference in New Issue
Block a user