Rename BeaconStateTypes to EthSpec

This commit is contained in:
Paul Hauner
2019-05-10 14:47:09 +10:00
parent 75b310a078
commit ce8ebeccbc
60 changed files with 223 additions and 235 deletions

View File

@@ -11,7 +11,7 @@ use log::{debug, trace};
use std::collections::HashMap;
use std::marker::PhantomData;
use std::sync::Arc;
use types::{BeaconBlock, BeaconState, BeaconStateTypes, ChainSpec, Hash256, Slot, SlotHeight};
use types::{BeaconBlock, BeaconState, ChainSpec, EthSpec, Hash256, Slot, SlotHeight};
//TODO: Pruning - Children
//TODO: Handle Syncing
@@ -54,7 +54,7 @@ pub struct BitwiseLMDGhost<T: ClientDB + Sized, B> {
_phantom: PhantomData<B>,
}
impl<T, B: BeaconStateTypes> BitwiseLMDGhost<T, B>
impl<T, B: EthSpec> BitwiseLMDGhost<T, B>
where
T: ClientDB + Sized,
{
@@ -243,7 +243,7 @@ where
}
}
impl<T: ClientDB + Sized, B: BeaconStateTypes> ForkChoice for BitwiseLMDGhost<T, B> {
impl<T: ClientDB + Sized, B: EthSpec> ForkChoice for BitwiseLMDGhost<T, B> {
fn add_block(
&mut self,
block: &BeaconBlock,

View File

@@ -11,7 +11,7 @@ use std::cmp::Ordering;
use std::collections::HashMap;
use std::marker::PhantomData;
use std::sync::Arc;
use types::{BeaconBlock, BeaconState, BeaconStateTypes, ChainSpec, Hash256, Slot, SlotHeight};
use types::{BeaconBlock, BeaconState, ChainSpec, EthSpec, Hash256, Slot, SlotHeight};
//TODO: Pruning - Children
//TODO: Handle Syncing
@@ -54,7 +54,7 @@ pub struct OptimizedLMDGhost<T: ClientDB + Sized, B> {
_phantom: PhantomData<B>,
}
impl<T, B: BeaconStateTypes> OptimizedLMDGhost<T, B>
impl<T, B: EthSpec> OptimizedLMDGhost<T, B>
where
T: ClientDB + Sized,
{
@@ -214,7 +214,7 @@ where
}
}
impl<T: ClientDB + Sized, B: BeaconStateTypes> ForkChoice for OptimizedLMDGhost<T, B> {
impl<T: ClientDB + Sized, B: EthSpec> ForkChoice for OptimizedLMDGhost<T, B> {
fn add_block(
&mut self,
block: &BeaconBlock,

View File

@@ -9,7 +9,7 @@ use log::{debug, trace};
use std::collections::HashMap;
use std::marker::PhantomData;
use std::sync::Arc;
use types::{BeaconBlock, BeaconState, BeaconStateTypes, ChainSpec, Hash256, Slot};
use types::{BeaconBlock, BeaconState, ChainSpec, EthSpec, Hash256, Slot};
//TODO: Pruning and syncing
@@ -26,7 +26,7 @@ pub struct SlowLMDGhost<T: ClientDB + Sized, B> {
_phantom: PhantomData<B>,
}
impl<T, B: BeaconStateTypes> SlowLMDGhost<T, B>
impl<T, B: EthSpec> SlowLMDGhost<T, B>
where
T: ClientDB + Sized,
{
@@ -108,7 +108,7 @@ where
}
}
impl<T: ClientDB + Sized, B: BeaconStateTypes> ForkChoice for SlowLMDGhost<T, B> {
impl<T: ClientDB + Sized, B: EthSpec> ForkChoice for SlowLMDGhost<T, B> {
/// Process when a block is added
fn add_block(
&mut self,