From 93a67c9a070851636ea245e24d1c569aaaec6b6f Mon Sep 17 00:00:00 2001 From: courtneyeh Date: Fri, 24 Nov 2023 10:13:45 +1100 Subject: [PATCH] Fix compiling bug --- .../client/ValidatorClientService.java | 7 +-- .../client/loader/ValidatorLoaderTest.java | 51 +++++++------------ 2 files changed, 19 insertions(+), 39 deletions(-) diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java index e068beac32d..b0b5288a910 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java @@ -144,9 +144,7 @@ public static ValidatorClientService create( new GenesisDataProvider(asyncRunner, validatorApiChannel); final ForkProvider forkProvider = new ForkProvider(config.getSpec(), genesisDataProvider); - final ValidatorLoader validatorLoader = - createValidatorLoader( - services, config, asyncRunner, validatorConfig.isExitWhenNoValidatorKeysEnabled()); + final ValidatorLoader validatorLoader = createValidatorLoader(services, config, asyncRunner); final ValidatorRestApiConfig validatorApiConfig = config.getValidatorRestApiConfig(); final ValidatorStatusProvider validatorStatusProvider = new OwnedValidatorStatusProvider( @@ -364,8 +362,7 @@ private static BeaconNodeApi createBeaconNodeApi( private static ValidatorLoader createValidatorLoader( final ServiceConfig services, final ValidatorClientConfiguration config, - final AsyncRunner asyncRunner, - final boolean exitWhenNoValidatorKeysEnabled) { + final AsyncRunner asyncRunner) { final Path slashingProtectionPath = getSlashingProtectionPath(services.getDataDirLayout()); final SlashingProtector slashingProtector = new LocalSlashingProtector( diff --git a/validator/client/src/test/java/tech/pegasys/teku/validator/client/loader/ValidatorLoaderTest.java b/validator/client/src/test/java/tech/pegasys/teku/validator/client/loader/ValidatorLoaderTest.java index c74ebbdab7a..d4a72c2236e 100644 --- a/validator/client/src/test/java/tech/pegasys/teku/validator/client/loader/ValidatorLoaderTest.java +++ b/validator/client/src/test/java/tech/pegasys/teku/validator/client/loader/ValidatorLoaderTest.java @@ -137,8 +137,7 @@ void shouldLoadPublicKeysFromUrls() { publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -176,8 +175,7 @@ void initializeValidatorsWithExternalSignerAndSlashingProtection() { publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -221,8 +219,7 @@ void initializeValidatorsWithExternalSignerAndNoSlashingProtection() { publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -268,8 +265,7 @@ void initializeValidatorsWithBothLocalAndExternalSigners(@TempDir Path tempDir) publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -314,8 +310,7 @@ void shouldInitializeLocalAndMutableValidators( publicKeyLoader, asyncRunner, metricsSystem, - Optional.of(dataDirLayout), - false); + Optional.of(dataDirLayout)); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -353,8 +348,7 @@ void shouldReturnErrorIfDeleteOnReadOnlySource(@TempDir Path tempDir) throws Exc publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); final DeleteKeyResult result = validatorLoader.deleteLocalMutableValidator(dataStructureUtil.randomPublicKey()); @@ -384,8 +378,7 @@ void shouldInitializeOnlyLocalValidatorsWhenRestDisabled( publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -440,8 +433,7 @@ void shouldNotInitializeMutableValidatorsWithoutDirectoryStructure( publicKeyLoader, asyncRunner, metricsSystem, - Optional.of(dataDirLayout), - false); + Optional.of(dataDirLayout)); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -477,8 +469,7 @@ void initializeValidatorsWithDuplicateKeysInLocalAndExternalSignersTakesExternal publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -513,8 +504,7 @@ void shouldEnableSlashingProtectionForLocalValidators(@TempDir Path tempDir) thr publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -555,8 +545,7 @@ void shouldLoadAdditionalExternalValidatorsOnReload() { publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -593,8 +582,7 @@ void shouldNotRemoveExternalValidatorsOnReload() { publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -626,8 +614,7 @@ void shouldLoadAdditionalLocalValidatorsOnReload(final @TempDir Path tempDir) th publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); // No validators initially validatorLoader.loadValidators(); @@ -662,8 +649,7 @@ void initializeInteropValidatorsWhenInteropIsEnabled() { publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators(); @@ -684,8 +670,7 @@ void shouldNotLoadMutableValidatorIfNotEnabled() { publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final LocalValidatorImportResult result = validatorLoader.loadLocalMutableValidator(null, "", Optional.empty(), true); @@ -710,8 +695,7 @@ void shouldLoadMutableValidatorIfEnabled(@TempDir final Path tempDir) throws Exc publicKeyLoader, asyncRunner, metricsSystem, - Optional.of(new SimpleDataDirLayout(tempDir)), - false); + Optional.of(new SimpleDataDirLayout(tempDir))); validatorLoader.loadValidators(); final String keystoreString = @@ -748,8 +732,7 @@ void doNotInitializeInteropValidatorsWhenInteropIsDisabled() { publicKeyLoader, asyncRunner, metricsSystem, - Optional.empty(), - false); + Optional.empty()); validatorLoader.loadValidators(); final OwnedValidators validators = validatorLoader.getOwnedValidators();