From 3e73a008eb5e0ece61a8d14157eabed85752174e Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Tue, 28 May 2019 16:10:52 +1000 Subject: [PATCH] Add constant for testnet validator count --- beacon_node/client/src/beacon_chain_types.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/beacon_node/client/src/beacon_chain_types.rs b/beacon_node/client/src/beacon_chain_types.rs index 968630069..8990e842d 100644 --- a/beacon_node/client/src/beacon_chain_types.rs +++ b/beacon_node/client/src/beacon_chain_types.rs @@ -13,6 +13,9 @@ use types::{ 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` pub trait InitialiseBeaconChain { fn initialise_beacon_chain(store: Arc, log: Logger) -> BeaconChain; @@ -74,8 +77,10 @@ where info!(log, "Initializing new BeaconChain from genesis"); let spec = T::EthSpec::spec(); - let state_builder = - TestingBeaconStateBuilder::from_default_keypairs_file_if_exists(8, &spec); + let state_builder = TestingBeaconStateBuilder::from_default_keypairs_file_if_exists( + TESTNET_VALIDATOR_COUNT, + &spec, + ); let (genesis_state, _keypairs) = state_builder.build(); let mut genesis_block = BeaconBlock::empty(&spec);