Add constant for testnet validator count
This commit is contained in:
parent
cb11656e12
commit
3e73a008eb
@ -13,6 +13,9 @@ use types::{
|
|||||||
test_utils::TestingBeaconStateBuilder, BeaconBlock, EthSpec, Hash256, LighthouseTestnetEthSpec,
|
test_utils::TestingBeaconStateBuilder, BeaconBlock, EthSpec, Hash256, LighthouseTestnetEthSpec,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// The number initial validators when starting the `LighthouseTestnet`.
|
||||||
|
const TESTNET_VALIDATOR_COUNT: usize = 16;
|
||||||
|
|
||||||
/// Provides a new, initialized `BeaconChain`
|
/// Provides a new, initialized `BeaconChain`
|
||||||
pub trait InitialiseBeaconChain<T: BeaconChainTypes> {
|
pub trait InitialiseBeaconChain<T: BeaconChainTypes> {
|
||||||
fn initialise_beacon_chain(store: Arc<T::Store>, log: Logger) -> BeaconChain<T>;
|
fn initialise_beacon_chain(store: Arc<T::Store>, log: Logger) -> BeaconChain<T>;
|
||||||
@ -74,8 +77,10 @@ where
|
|||||||
info!(log, "Initializing new BeaconChain from genesis");
|
info!(log, "Initializing new BeaconChain from genesis");
|
||||||
let spec = T::EthSpec::spec();
|
let spec = T::EthSpec::spec();
|
||||||
|
|
||||||
let state_builder =
|
let state_builder = TestingBeaconStateBuilder::from_default_keypairs_file_if_exists(
|
||||||
TestingBeaconStateBuilder::from_default_keypairs_file_if_exists(8, &spec);
|
TESTNET_VALIDATOR_COUNT,
|
||||||
|
&spec,
|
||||||
|
);
|
||||||
let (genesis_state, _keypairs) = state_builder.build();
|
let (genesis_state, _keypairs) = state_builder.build();
|
||||||
|
|
||||||
let mut genesis_block = BeaconBlock::empty(&spec);
|
let mut genesis_block = BeaconBlock::empty(&spec);
|
||||||
|
Loading…
Reference in New Issue
Block a user