Update beacon_node to work w/ BeaconStateTypes

This commit is contained in:
Paul Hauner
2019-05-09 09:40:32 +10:00
parent 42b7aa89d4
commit 4c0c93f0c9
5 changed files with 34 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ pub trait BeaconStateTypes: 'static + Default + Sync + Send + Clone + Debug + Pa
fn spec() -> ChainSpec;
}
/// Ethereum Foundation specifications.
#[derive(Clone, PartialEq, Debug, Default)]
pub struct FoundationStateTypes;
@@ -45,3 +46,20 @@ impl BeaconStateTypes for FewValidatorsStateTypes {
}
pub type FewValidatorsBeaconState = BeaconState<FewValidatorsStateTypes>;
#[derive(Clone, PartialEq, Debug, Default)]
pub struct LighthouseTestnetStateTypes;
impl BeaconStateTypes for LighthouseTestnetStateTypes {
type ShardCount = U8;
type SlotsPerHistoricalRoot = U8192;
type LatestRandaoMixesLength = U8192;
type LatestActiveIndexRootsLength = U8192;
type LatestSlashedExitLength = U8192;
fn spec() -> ChainSpec {
ChainSpec::lighthouse_testnet()
}
}
pub type LighthouseTestnetBeaconState = BeaconState<LighthouseTestnetStateTypes>;