Skip to content

Commit

Permalink
fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-aouadi committed Aug 2, 2024
1 parent 5ccf89d commit fa1bc35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,21 @@ public class RemoteValidatorApiHandler implements RemoteValidatorApiChannel {
static final int MAX_RATE_LIMITING_RETRIES = 3;

private final HttpUrl endpoint;
private final Spec spec;
private final ValidatorRestApiClient apiClient;
private final OkHttpValidatorTypeDefClient typeDefClient;
private final AsyncRunner asyncRunner;
private final AtomicBoolean usePostValidatorsEndpoint;

public RemoteValidatorApiHandler(
final HttpUrl endpoint,
final Spec spec,
final ValidatorRestApiClient apiClient,
final OkHttpValidatorTypeDefClient typeDefClient,
final AsyncRunner asyncRunner,
final boolean usePostValidatorsEndpoint) {
this.endpoint = endpoint;
this.spec = spec;
this.apiClient = apiClient;
this.asyncRunner = asyncRunner;
this.typeDefClient = typeDefClient;
Expand Down Expand Up @@ -452,6 +455,6 @@ public static RemoteValidatorApiHandler create(
final OkHttpValidatorTypeDefClient typeDefClient =
new OkHttpValidatorTypeDefClient(httpClient, endpoint, spec, preferSszBlockEncoding);
return new RemoteValidatorApiHandler(
endpoint, apiClient, typeDefClient, asyncRunner, usePostValidatorsEndpoint);
endpoint, spec, apiClient, typeDefClient, asyncRunner, usePostValidatorsEndpoint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class RemoteValidatorApiHandlerTest {
@BeforeEach
public void beforeEach() {
apiHandler =
new RemoteValidatorApiHandler(endpoint, apiClient, typeDefClient, asyncRunner, true);
new RemoteValidatorApiHandler(endpoint, spec, apiClient, typeDefClient, asyncRunner, true);
}

@Test
Expand Down Expand Up @@ -521,7 +521,7 @@ public void postAttestations_ShouldUseV1ApiPreElectra() {
}

@Test
public void createAggregate_ShouldUseV2ApiPostElectra() {
public void postAttestations_ShouldUseV2ApiPostElectra() {
final Spec electraSpec = TestSpecFactory.createMainnetElectra();

apiHandler =
Expand All @@ -533,7 +533,7 @@ public void createAggregate_ShouldUseV2ApiPostElectra() {
ignoreFuture(apiHandler.sendSignedAttestations(attestations));
asyncRunner.executeQueuedActions();

verify(apiClient, never()).createAggregate(any(), any());
verify(apiClient, never()).sendSignedAttestations(any());
verify(typeDefClient)
.postSignedAttestations(attestations, electraSpec.getGenesisSpec().getMilestone());
}
Expand Down

0 comments on commit fa1bc35

Please sign in to comment.