Skip to content

Commit

Permalink
minor refactoring of variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
usmansaleem committed Oct 17, 2024
1 parent ad8cadd commit af3ee4e
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions core/src/main/java/tech/pegasys/web3signer/core/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ public class Context {
private final MetricsSystem metricsSystem;
private final LogErrorHandler errorHandler;
private final Vertx vertx;
private final List<ArtifactSignerProvider> artifactSignerProvider;
private final List<ArtifactSignerProvider> artifactSignerProviders;

public Context(
final Router router,
final MetricsSystem metricsSystem,
final LogErrorHandler errorHandler,
final Vertx vertx,
final List<ArtifactSignerProvider> artifactSignerProvider) {
final List<ArtifactSignerProvider> artifactSignerProviders) {
this.router = router;
this.metricsSystem = metricsSystem;
this.errorHandler = errorHandler;
this.vertx = vertx;
this.artifactSignerProvider = artifactSignerProvider;
this.artifactSignerProviders = artifactSignerProviders;
}

public Router getRouter() {
Expand All @@ -57,7 +57,7 @@ public Vertx getVertx() {
return vertx;
}

public List<ArtifactSignerProvider> getArtifactSignerProvider() {
return artifactSignerProvider;
public List<ArtifactSignerProvider> getArtifactSignerProviders() {
return artifactSignerProviders;
}
}
8 changes: 4 additions & 4 deletions core/src/main/java/tech/pegasys/web3signer/core/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void run() {
final LogErrorHandler errorHandler = new LogErrorHandler();
healthCheckHandler = HealthCheckHandler.create(vertx);

final List<ArtifactSignerProvider> artifactSignerProvider =
final List<ArtifactSignerProvider> artifactSignerProviders =
Optional.ofNullable(createArtifactSignerProvider(vertx, metricsSystem)).orElse(List.of());

try {
Expand All @@ -120,7 +120,7 @@ public void run() {
metricsService.ifPresent(MetricsService::start);

// load the artifact signer providers in order ...
artifactSignerProvider.forEach(
artifactSignerProviders.forEach(
provider -> {
try {
provider.load().get(); // wait for signers to get loaded ...
Expand Down Expand Up @@ -163,7 +163,7 @@ public void run() {
registerHealthCheckProcedure(DEFAULT_CHECK, promise -> promise.complete(Status.OK()));

final Context context =
new Context(router, metricsSystem, errorHandler, vertx, artifactSignerProvider);
new Context(router, metricsSystem, errorHandler, vertx, artifactSignerProviders);

populateRouter(context);
if (baseConfig.isSwaggerUIEnabled()) {
Expand All @@ -183,7 +183,7 @@ public void run() {

closeables.add(() -> shutdownVertx(vertx));
} catch (final Throwable e) {
artifactSignerProvider.forEach(ArtifactSignerProvider::close);
artifactSignerProviders.forEach(ArtifactSignerProvider::close);
shutdownVertx(vertx);
metricsService.ifPresent(MetricsService::stop);
LOG.error("Failed to initialise application", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void register() {
.produces(JSON_HEADER)
.handler(
new BlockingHandlerDecorator(
new PublicKeysListHandler(context.getArtifactSignerProvider()), false))
new PublicKeysListHandler(context.getArtifactSignerProviders()), false))
.failureHandler(context.getErrorHandler());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void register() {
.getRouter()
.route(HttpMethod.POST, RELOAD_PATH)
.produces(JSON_HEADER)
.handler(new ReloadHandler(context.getArtifactSignerProvider()))
.handler(new ReloadHandler(context.getArtifactSignerProviders()))
.failureHandler(context.getErrorHandler());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Eth1SignRoute(final Context context) {

// we need signerProvider which is an instance of DefaultArtifactSignerProvider
final Optional<ArtifactSignerProvider> first =
context.getArtifactSignerProvider().stream()
context.getArtifactSignerProviders().stream()
.filter(provider -> provider instanceof DefaultArtifactSignerProvider)
.findFirst();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public JsonRpcRoute(final Context context, final Eth1Config eth1Config) {

// we need signerProvider which is an instance of SecpArtifactSignerProviderAdapter
final Optional<ArtifactSignerProvider> first =
context.getArtifactSignerProvider().stream()
context.getArtifactSignerProviders().stream()
.filter(provider -> provider instanceof SecpArtifactSignerProviderAdapter)
.findFirst();
final ArtifactSignerProvider signerProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Eth2SignExtensionRoute(final Context context) {
// there should be only one ArtifactSignerProvider in eth2 mode at the moment which is of BLS
// types.
final ArtifactSignerProvider artifactSignerProvider =
context.getArtifactSignerProvider().stream().findFirst().orElseThrow();
context.getArtifactSignerProviders().stream().findFirst().orElseThrow();

blsSigner =
new SignerForIdentifier<>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public Eth2SignRoute(
// there should be only one ArtifactSignerProvider in eth2 mode at the moment which is of BLS
// types.
final ArtifactSignerProvider artifactSignerProvider =
context.getArtifactSignerProvider().stream().findFirst().orElseThrow();
context.getArtifactSignerProviders().stream().findFirst().orElseThrow();

blsSigner =
new SignerForIdentifier<>(
Expand All @@ -64,7 +64,7 @@ public void register() {
// there should be only one ArtifactSignerProvider in eth2 mode at the moment which is of BLS
// types.
final ArtifactSignerProvider artifactSignerProvider =
context.getArtifactSignerProvider().stream().findFirst().orElseThrow();
context.getArtifactSignerProviders().stream().findFirst().orElseThrow();

context
.getRouter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public KeyManagerApiRoute(
slashingProtectionContext.map(SlashingProtectionContext::getSlashingProtection);
// there should be only one ArtifactSignerProvider in eth2 mode at the moment which is of BLS
// types.
blsSignerProvider = context.getArtifactSignerProvider().stream().findFirst().orElseThrow();
blsSignerProvider = context.getArtifactSignerProviders().stream().findFirst().orElseThrow();
}

@Override
Expand Down

0 comments on commit af3ee4e

Please sign in to comment.