@Test void initializeValidatorsWithBothLocalAndExternalSigners(@TempDir Path tempDir) throws Exception { writeKeystore(tempDir); final GlobalConfiguration globalConfig = GlobalConfiguration.builder().build(); final ValidatorConfig config = ValidatorConfig.builder() .validatorExternalSignerUrl(SIGNER_URL) .validatorExternalSignerPublicKeys(Collections.singletonList(PUBLIC_KEY2)) .validatorKeys( List.of( tempDir.toAbsolutePath().toString() + File.pathSeparator + tempDir.toAbsolutePath().toString())) .build(); final Map<BLSPublicKey, Validator> validators = validatorLoader.initializeValidators(config, globalConfig); assertThat(validators).hasSize(2); final Validator validator1 = validators.get(PUBLIC_KEY1); assertThat(validator1).isNotNull(); assertThat(validator1.getPublicKey()).isEqualTo(PUBLIC_KEY1); assertThat(validator1.getSigner().isLocal()).isTrue(); final Validator validator2 = validators.get(PUBLIC_KEY2); assertThat(validator2).isNotNull(); assertThat(validator2.getPublicKey()).isEqualTo(PUBLIC_KEY2); assertThat(validator2.getSigner().isLocal()).isFalse(); }
public Map<BLSPublicKey, Validator> initializeValidators( ValidatorConfig config, final GlobalConfiguration globalConfiguration) { final Map<BLSPublicKey, Validator> validators = new HashMap<>(); validators.putAll(createLocalSignerValidator(config, globalConfiguration)); validators.putAll(createExternalSignerValidator(config)); STATUS_LOG.validatorsInitialised( validators.values().stream() .map(Validator::getPublicKey) .map(BLSPublicKey::toAbbreviatedString) .collect(Collectors.toList())); return validators; }
ValidatorLoader { public Map<BLSPublicKey, Validator> initializeValidators( ValidatorConfig config, final GlobalConfiguration globalConfiguration) { final Map<BLSPublicKey, Validator> validators = new HashMap<>(); validators.putAll(createLocalSignerValidator(config, globalConfiguration)); validators.putAll(createExternalSignerValidator(config)); STATUS_LOG.validatorsInitialised( validators.values().stream() .map(Validator::getPublicKey) .map(BLSPublicKey::toAbbreviatedString) .collect(Collectors.toList())); return validators; } }
ValidatorLoader { public Map<BLSPublicKey, Validator> initializeValidators( ValidatorConfig config, final GlobalConfiguration globalConfiguration) { final Map<BLSPublicKey, Validator> validators = new HashMap<>(); validators.putAll(createLocalSignerValidator(config, globalConfiguration)); validators.putAll(createExternalSignerValidator(config)); STATUS_LOG.validatorsInitialised( validators.values().stream() .map(Validator::getPublicKey) .map(BLSPublicKey::toAbbreviatedString) .collect(Collectors.toList())); return validators; } ValidatorLoader(final SlashingProtector slashingProtector, final AsyncRunner asyncRunner); }
ValidatorLoader { public Map<BLSPublicKey, Validator> initializeValidators( ValidatorConfig config, final GlobalConfiguration globalConfiguration) { final Map<BLSPublicKey, Validator> validators = new HashMap<>(); validators.putAll(createLocalSignerValidator(config, globalConfiguration)); validators.putAll(createExternalSignerValidator(config)); STATUS_LOG.validatorsInitialised( validators.values().stream() .map(Validator::getPublicKey) .map(BLSPublicKey::toAbbreviatedString) .collect(Collectors.toList())); return validators; } ValidatorLoader(final SlashingProtector slashingProtector, final AsyncRunner asyncRunner); Map<BLSPublicKey, Validator> initializeValidators(
      ValidatorConfig config, final GlobalConfiguration globalConfiguration); }
ValidatorLoader { public Map<BLSPublicKey, Validator> initializeValidators( ValidatorConfig config, final GlobalConfiguration globalConfiguration) { final Map<BLSPublicKey, Validator> validators = new HashMap<>(); validators.putAll(createLocalSignerValidator(config, globalConfiguration)); validators.putAll(createExternalSignerValidator(config)); STATUS_LOG.validatorsInitialised( validators.values().stream() .map(Validator::getPublicKey) .map(BLSPublicKey::toAbbreviatedString) .collect(Collectors.toList())); return validators; } ValidatorLoader(final SlashingProtector slashingProtector, final AsyncRunner asyncRunner); Map<BLSPublicKey, Validator> initializeValidators(
      ValidatorConfig config, final GlobalConfiguration globalConfiguration);  }