mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 21:38:31 +00:00
Update beacon_node to work w/ BeaconStateTypes
This commit is contained in:
@@ -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>;
|
||||
|
||||
@@ -29,7 +29,6 @@ impl<T, N: Unsigned> FixedLenVec<T, N> {
|
||||
|
||||
impl<T: Default, N: Unsigned> From<Vec<T>> for FixedLenVec<T, N> {
|
||||
fn from(mut vec: Vec<T>) -> Self {
|
||||
dbg!(Self::capacity());
|
||||
vec.resize_with(Self::capacity(), Default::default);
|
||||
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user