diff --git a/core/src/main/java/tech/pegasys/web3signer/core/Eth1Runner.java b/core/src/main/java/tech/pegasys/web3signer/core/Eth1Runner.java index 9da51a603..0fa92854e 100644 --- a/core/src/main/java/tech/pegasys/web3signer/core/Eth1Runner.java +++ b/core/src/main/java/tech/pegasys/web3signer/core/Eth1Runner.java @@ -28,7 +28,6 @@ import tech.pegasys.web3signer.signing.ArtifactSigner; import tech.pegasys.web3signer.signing.ArtifactSignerProvider; import tech.pegasys.web3signer.signing.EthSecpArtifactSigner; -import tech.pegasys.web3signer.signing.SecpArtifactSignature; import tech.pegasys.web3signer.signing.bulkloading.SecpAwsBulkLoader; import tech.pegasys.web3signer.signing.bulkloading.SecpAzureBulkLoader; import tech.pegasys.web3signer.signing.bulkloading.SecpV3KeystoresBulkLoader; @@ -239,10 +238,6 @@ private MappedResults bulkloadV3Keystores() { return walletResults; } - private String formatSecpSignature(final SecpArtifactSignature signature) { - return SecpArtifactSignature.toBytes(signature).toHexString(); - } - private void registerSignerLoadingHealthCheck( final String name, final MappedResults result) { super.registerHealthCheckProcedure( diff --git a/core/src/main/java/tech/pegasys/web3signer/core/routes/PublicKeysListRoute.java b/core/src/main/java/tech/pegasys/web3signer/core/routes/PublicKeysListRoute.java index 6c9ff0dae..4e76858a6 100644 --- a/core/src/main/java/tech/pegasys/web3signer/core/routes/PublicKeysListRoute.java +++ b/core/src/main/java/tech/pegasys/web3signer/core/routes/PublicKeysListRoute.java @@ -20,14 +20,21 @@ public class PublicKeysListRoute implements Web3SignerRoute { - private static final String PATH_FORMAT = "/api/v1/%s/publicKeys"; + private static final String ETH1_PATH = "/api/v1/eth1/publicKeys"; + private static final String ETH2_PATH = "/api/v1/eth2/publicKeys"; private final Context context; private final String path; public PublicKeysListRoute(final Context context, final String mode) { this.context = context; - this.path = String.format(PATH_FORMAT, mode); + this.path = + switch (mode) { + case "eth1" -> ETH1_PATH; + case "eth2" -> ETH2_PATH; + default -> + throw new IllegalArgumentException("Unsupported mode for Public Key Route: " + mode); + }; } @Override diff --git a/core/src/main/java/tech/pegasys/web3signer/core/service/http/handlers/PublicKeysListHandler.java b/core/src/main/java/tech/pegasys/web3signer/core/service/http/handlers/PublicKeysListHandler.java index 42252fbbe..d373b2916 100644 --- a/core/src/main/java/tech/pegasys/web3signer/core/service/http/handlers/PublicKeysListHandler.java +++ b/core/src/main/java/tech/pegasys/web3signer/core/service/http/handlers/PublicKeysListHandler.java @@ -16,6 +16,7 @@ import static tech.pegasys.web3signer.core.service.http.handlers.ContentTypes.JSON_UTF_8; import tech.pegasys.web3signer.signing.ArtifactSignerProvider; +import tech.pegasys.web3signer.signing.config.DefaultArtifactSignerProvider; import java.util.List; import java.util.stream.Collectors; @@ -33,8 +34,11 @@ public PublicKeysListHandler(final List artifactSignerPr @Override public void handle(final RoutingContext context) { + // at the moment, we only support DefaultArtifactSignerProvider subclass that contains primary + // key as identifiers final List availableIdentifiers = artifactSignerProviders.stream() + .filter(provider -> provider instanceof DefaultArtifactSignerProvider) .flatMap(provider -> provider.availableIdentifiers().stream()) .collect(Collectors.toList());