mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-18 04:13:00 +00:00
Use E for EthSpec trait, instead of B
This commit is contained in:
@@ -15,14 +15,14 @@ use types::{
|
||||
pub use beacon_chain::{BeaconChainError, BlockProcessingOutcome, InvalidBlock};
|
||||
|
||||
/// The network's API to the beacon chain.
|
||||
pub trait BeaconChain<B: EthSpec>: Send + Sync {
|
||||
pub trait BeaconChain<E: EthSpec>: Send + Sync {
|
||||
fn get_spec(&self) -> &ChainSpec;
|
||||
|
||||
fn get_state(&self) -> RwLockReadGuard<BeaconState<B>>;
|
||||
fn get_state(&self) -> RwLockReadGuard<BeaconState<E>>;
|
||||
|
||||
fn slot(&self) -> Slot;
|
||||
|
||||
fn head(&self) -> RwLockReadGuard<CheckPoint<B>>;
|
||||
fn head(&self) -> RwLockReadGuard<CheckPoint<E>>;
|
||||
|
||||
fn get_block(&self, block_root: &Hash256) -> Result<Option<BeaconBlock>, BeaconChainError>;
|
||||
|
||||
@@ -30,7 +30,7 @@ pub trait BeaconChain<B: EthSpec>: Send + Sync {
|
||||
|
||||
fn best_block_root(&self) -> Hash256;
|
||||
|
||||
fn finalized_head(&self) -> RwLockReadGuard<CheckPoint<B>>;
|
||||
fn finalized_head(&self) -> RwLockReadGuard<CheckPoint<E>>;
|
||||
|
||||
fn finalized_epoch(&self) -> Epoch;
|
||||
|
||||
@@ -64,18 +64,18 @@ pub trait BeaconChain<B: EthSpec>: Send + Sync {
|
||||
fn is_new_block_root(&self, beacon_block_root: &Hash256) -> Result<bool, BeaconChainError>;
|
||||
}
|
||||
|
||||
impl<T, U, F, B> BeaconChain<B> for RawBeaconChain<T, U, F, B>
|
||||
impl<T, U, F, E> BeaconChain<E> for RawBeaconChain<T, U, F, E>
|
||||
where
|
||||
T: ClientDB + Sized,
|
||||
U: SlotClock,
|
||||
F: ForkChoice,
|
||||
B: EthSpec,
|
||||
E: EthSpec,
|
||||
{
|
||||
fn get_spec(&self) -> &ChainSpec {
|
||||
&self.spec
|
||||
}
|
||||
|
||||
fn get_state(&self) -> RwLockReadGuard<BeaconState<B>> {
|
||||
fn get_state(&self) -> RwLockReadGuard<BeaconState<E>> {
|
||||
self.state.read()
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ where
|
||||
self.get_state().slot
|
||||
}
|
||||
|
||||
fn head(&self) -> RwLockReadGuard<CheckPoint<B>> {
|
||||
fn head(&self) -> RwLockReadGuard<CheckPoint<E>> {
|
||||
self.head()
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ where
|
||||
self.get_state().finalized_epoch
|
||||
}
|
||||
|
||||
fn finalized_head(&self) -> RwLockReadGuard<CheckPoint<B>> {
|
||||
fn finalized_head(&self) -> RwLockReadGuard<CheckPoint<E>> {
|
||||
self.finalized_head()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user