use of tech.pegasys.teku.core.signatures.SlashingProtectedSigner in project teku by ConsenSys.
the class SlashingProtectedValidatorSource method addValidator.
@Override
public AddValidatorResult addValidator(final KeyStoreData keyStoreData, final String password, final BLSPublicKey publicKey) {
AddValidatorResult delegateResult = delegate.addValidator(keyStoreData, password, publicKey);
if (delegateResult.getSigner().isEmpty()) {
return delegateResult;
}
final Signer signer = delegateResult.getSigner().get();
return new AddValidatorResult(delegateResult.getResult(), Optional.of(new SlashingProtectedSigner(publicKey, slashingProtector, signer)));
}
use of tech.pegasys.teku.core.signatures.SlashingProtectedSigner in project teku by ConsenSys.
the class SlashingProtectionLoggerTest method createProtectedValidator.
private Validator createProtectedValidator(BLSPublicKey publicKey) {
Signer localSigner = new NoOpLocalSigner();
Signer signer = new SlashingProtectedSigner(publicKey, slashingProtector, localSigner);
return new Validator(publicKey, signer, mock(GraffitiProvider.class));
}
Aggregations