Search in sources :

Example 1 with Eth1SignForIdentifierHandler

use of tech.pegasys.web3signer.core.service.http.handlers.signing.Eth1SignForIdentifierHandler in project web3signer by ConsenSys.

the class Eth1Runner method populateRouter.

@Override
protected Router populateRouter(final Context context) {
    final RouterBuilder routerBuilder = context.getRouterBuilder();
    final LogErrorHandler errorHandler = context.getErrorHandler();
    final ArtifactSignerProvider signerProvider = context.getArtifactSignerProvider();
    addPublicKeysListHandler(routerBuilder, signerProvider, ETH1_LIST.name(), context.getErrorHandler());
    final SignerForIdentifier<SecpArtifactSignature> secpSigner = new SignerForIdentifier<>(signerProvider, this::formatSecpSignature, SECP256K1);
    routerBuilder.operation(ETH1_SIGN.name()).handler(new BlockingHandlerDecorator(new Eth1SignForIdentifierHandler(secpSigner, new HttpApiMetrics(context.getMetricsSystem(), SECP256K1)), false)).failureHandler(errorHandler);
    addReloadHandler(routerBuilder, signerProvider, RELOAD.name(), context.getErrorHandler());
    return context.getRouterBuilder().createRouter();
}
Also used : SignerForIdentifier(tech.pegasys.web3signer.core.service.http.handlers.signing.SignerForIdentifier) BlockingHandlerDecorator(io.vertx.ext.web.impl.BlockingHandlerDecorator) SecpArtifactSignature(tech.pegasys.web3signer.signing.SecpArtifactSignature) RouterBuilder(io.vertx.ext.web.openapi.RouterBuilder) ArtifactSignerProvider(tech.pegasys.web3signer.signing.ArtifactSignerProvider) DefaultArtifactSignerProvider(tech.pegasys.web3signer.signing.config.DefaultArtifactSignerProvider) Eth1SignForIdentifierHandler(tech.pegasys.web3signer.core.service.http.handlers.signing.Eth1SignForIdentifierHandler) HttpApiMetrics(tech.pegasys.web3signer.core.service.http.metrics.HttpApiMetrics) LogErrorHandler(tech.pegasys.web3signer.core.service.http.handlers.LogErrorHandler)

Aggregations

BlockingHandlerDecorator (io.vertx.ext.web.impl.BlockingHandlerDecorator)1 RouterBuilder (io.vertx.ext.web.openapi.RouterBuilder)1 LogErrorHandler (tech.pegasys.web3signer.core.service.http.handlers.LogErrorHandler)1 Eth1SignForIdentifierHandler (tech.pegasys.web3signer.core.service.http.handlers.signing.Eth1SignForIdentifierHandler)1 SignerForIdentifier (tech.pegasys.web3signer.core.service.http.handlers.signing.SignerForIdentifier)1 HttpApiMetrics (tech.pegasys.web3signer.core.service.http.metrics.HttpApiMetrics)1 ArtifactSignerProvider (tech.pegasys.web3signer.signing.ArtifactSignerProvider)1 SecpArtifactSignature (tech.pegasys.web3signer.signing.SecpArtifactSignature)1 DefaultArtifactSignerProvider (tech.pegasys.web3signer.signing.config.DefaultArtifactSignerProvider)1