mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 13:54:44 +00:00
Add flag for web3 server
This commit is contained in:
@@ -48,7 +48,9 @@ pub enum Error {
|
||||
BackendError(String),
|
||||
}
|
||||
|
||||
pub trait Eth1ChainBackend<T: EthSpec> {
|
||||
pub trait Eth1ChainBackend<T: EthSpec>: Sized + Send + Sync {
|
||||
fn new(server: String) -> Result<Self>;
|
||||
|
||||
/// Returns the `Eth1Data` that should be included in a block being produced for the given
|
||||
/// `state`.
|
||||
fn eth1_data(&self, beacon_state: &BeaconState<T>) -> Result<Eth1Data>;
|
||||
@@ -68,6 +70,10 @@ pub struct InteropEth1ChainBackend<T: EthSpec> {
|
||||
}
|
||||
|
||||
impl<T: EthSpec> Eth1ChainBackend<T> for InteropEth1ChainBackend<T> {
|
||||
fn new(_server: String) -> Result<Self> {
|
||||
Ok(Self::default())
|
||||
}
|
||||
|
||||
fn eth1_data(&self, state: &BeaconState<T>) -> Result<Eth1Data> {
|
||||
let current_epoch = state.current_epoch();
|
||||
let slots_per_voting_period = T::slots_per_eth1_voting_period() as u64;
|
||||
|
||||
@@ -19,7 +19,7 @@ pub use self::beacon_chain::{
|
||||
pub use self::checkpoint::CheckPoint;
|
||||
pub use self::errors::{BeaconChainError, BlockProductionError};
|
||||
pub use beacon_chain_builder::BeaconChainBuilder;
|
||||
pub use eth1_chain::InteropEth1ChainBackend;
|
||||
pub use eth1_chain::{Eth1ChainBackend, InteropEth1ChainBackend};
|
||||
pub use lmd_ghost;
|
||||
pub use metrics::scrape_for_metrics;
|
||||
pub use parking_lot;
|
||||
|
||||
Reference in New Issue
Block a user