Search in sources :

Example 1 with SlashingProtectedSigner

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)));
}
Also used : Signer(tech.pegasys.teku.core.signatures.Signer) SlashingProtectedSigner(tech.pegasys.teku.core.signatures.SlashingProtectedSigner) SlashingProtectedSigner(tech.pegasys.teku.core.signatures.SlashingProtectedSigner)

Example 2 with SlashingProtectedSigner

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));
}
Also used : Signer(tech.pegasys.teku.core.signatures.Signer) ExternalSigner(tech.pegasys.teku.validator.client.signer.ExternalSigner) SlashingProtectedSigner(tech.pegasys.teku.core.signatures.SlashingProtectedSigner) NoOpLocalSigner(tech.pegasys.teku.core.signatures.NoOpLocalSigner) SlashingProtectedSigner(tech.pegasys.teku.core.signatures.SlashingProtectedSigner) GraffitiProvider(tech.pegasys.teku.validator.api.GraffitiProvider) NoOpLocalSigner(tech.pegasys.teku.core.signatures.NoOpLocalSigner) Validator(tech.pegasys.teku.validator.client.Validator)

Aggregations

Signer (tech.pegasys.teku.core.signatures.Signer)2 SlashingProtectedSigner (tech.pegasys.teku.core.signatures.SlashingProtectedSigner)2 NoOpLocalSigner (tech.pegasys.teku.core.signatures.NoOpLocalSigner)1 GraffitiProvider (tech.pegasys.teku.validator.api.GraffitiProvider)1 Validator (tech.pegasys.teku.validator.client.Validator)1 ExternalSigner (tech.pegasys.teku.validator.client.signer.ExternalSigner)1