use of tech.pegasys.teku.validator.api.InteropConfig in project teku by ConsenSys.
the class BeaconChainController method setupInteropState.
protected void setupInteropState() {
final InteropConfig config = beaconConfig.interopConfig();
STATUS_LOG.generatingMockStartGenesis(config.getInteropGenesisTime(), config.getInteropNumberOfValidators());
final BeaconState genesisState = InteropStartupUtil.createMockedStartInitialBeaconState(spec, config.getInteropGenesisTime(), config.getInteropNumberOfValidators());
recentChainData.initializeFromGenesis(genesisState, timeProvider.getTimeInSeconds());
EVENT_LOG.genesisEvent(genesisState.hashTreeRoot(), recentChainData.getBestBlockRoot().orElseThrow(), genesisState.getGenesis_time());
}
use of tech.pegasys.teku.validator.api.InteropConfig in project teku by ConsenSys.
the class BeaconNodeCommandTest method interopEnabled_shouldNotRequireAValue.
@Test
public void interopEnabled_shouldNotRequireAValue() {
final InteropConfig config = getTekuConfigurationFromArguments("--Xinterop-enabled").beaconChain().interopConfig();
assertThat(config.isInteropEnabled()).isTrue();
}
use of tech.pegasys.teku.validator.api.InteropConfig in project teku by ConsenSys.
the class ValidatorLoaderTest method initializeInteropValidatorsWhenInteropIsEnabled.
@Test
void initializeInteropValidatorsWhenInteropIsEnabled() {
final int ownedValidatorCount = 10;
final InteropConfig interopConfig = InteropConfig.builder().specProvider(spec).interopEnabled(true).interopOwnedValidatorCount(ownedValidatorCount).build();
final ValidatorConfig config = ValidatorConfig.builder().build();
final ValidatorLoader validatorLoader = ValidatorLoader.create(spec, config, interopConfig, httpClientFactory, slashingProtector, slashingProtectionLogger, publicKeyLoader, asyncRunner, metricsSystem, Optional.empty());
validatorLoader.loadValidators();
final OwnedValidators validators = validatorLoader.getOwnedValidators();
assertThat(validators.getValidatorCount()).isEqualTo(ownedValidatorCount);
}
use of tech.pegasys.teku.validator.api.InteropConfig in project teku by ConsenSys.
the class ValidatorLoaderTest method doNotInitializeInteropValidatorsWhenInteropIsDisabled.
@Test
void doNotInitializeInteropValidatorsWhenInteropIsDisabled() {
final int ownedValidatorCount = 10;
final InteropConfig interopConfig = InteropConfig.builder().specProvider(spec).interopEnabled(false).interopOwnedValidatorCount(ownedValidatorCount).build();
final ValidatorConfig config = ValidatorConfig.builder().build();
final ValidatorLoader validatorLoader = ValidatorLoader.create(spec, config, interopConfig, httpClientFactory, slashingProtector, slashingProtectionLogger, publicKeyLoader, asyncRunner, metricsSystem, Optional.empty());
validatorLoader.loadValidators();
final OwnedValidators validators = validatorLoader.getOwnedValidators();
assertThat(validators.hasNoValidators()).isTrue();
}
Aggregations