Skip to content

Commit

Permalink
add missing final - data module(Consensys#8217)
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Fukushima <[email protected]>
  • Loading branch information
gfukushima authored Apr 18, 2024
1 parent 0be6e13 commit 9973928
Show file tree
Hide file tree
Showing 166 changed files with 375 additions and 351 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public PutLogLevel() {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final LogLevel requestBody = request.getRequestBody();
final List<String> logFilters = requestBody.getLogFilter().orElse(List.of(""));

Expand Down Expand Up @@ -85,15 +85,15 @@ public Level getLevel() {
return level;
}

public void setLevel(Level level) {
public void setLevel(final Level level) {
this.level = level;
}

public Optional<List<String>> getLogFilter() {
return logFilter;
}

public void setLogFilter(Optional<List<String>> logFilter) {
public void setLogFilter(final Optional<List<String>> logFilter) {
this.logFilter = logFilter;
}

Expand All @@ -111,7 +111,7 @@ static DeserializableTypeDefinition<LogLevel> getJsonTypeDefinition() {
}

@Override
public boolean equals(Object o) {
public boolean equals(final Object o) {
if (this == o) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Readiness(final DataProvider provider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(Header.CACHE_CONTROL, CACHE_NONE);

if (!chainDataProvider.isStoreAvailable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static EndpointMetadata createEndpointMetadata(final SchemaDefinitionCac
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final List<UInt64> indices = request.getQueryParameterList(BLOB_INDICES_PARAMETER);
final SafeFuture<Optional<List<BlobSidecar>>> future =
chainDataProvider.getAllBlobSidecarsAtSlot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public GetAllBlocksAtSlot(
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(Header.CACHE_CONTROL, CACHE_NONE);

final UInt64 slot = request.getPathParameter(SLOT_PARAMETER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class GetEth1DataCache extends RestApiEndpoint {

private final Eth1DataProvider eth1DataProvider;

public GetEth1DataCache(Eth1DataProvider eth1DataProvider) {
public GetEth1DataCache(final Eth1DataProvider eth1DataProvider) {
super(
EndpointMetadata.get(ROUTE)
.operationId("getTekuV1BeaconPoolEth1cache")
Expand All @@ -60,7 +60,7 @@ public GetEth1DataCache(Eth1DataProvider eth1DataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(Header.CACHE_CONTROL, CACHE_NONE);
Collection<Eth1Data> eth1CachedBlocks = this.eth1DataProvider.getEth1CachedBlocks();
if (eth1CachedBlocks.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public GetProposersData(final DataProvider provider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(CACHE_CONTROL, CACHE_NONE);
request.respondOk(
new ProposersData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public GetStateByBlockRoot(final ChainDataProvider chainDataProvider, final Spec
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(Header.CACHE_CONTROL, CACHE_NONE);

final String blockId = request.getPathParameter(PARAMETER_BLOCK_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public GetPeersScore(final DataProvider provider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(Header.CACHE_CONTROL, CACHE_NONE);
request.respondOk(network.getPeerScores());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public AbstractGetSimpleDataFromState(
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final SafeFuture<Optional<StateAndMetaData>> future =
chainDataProvider.getBeaconStateAndMetadata(request.getPathParameter(PARAMETER_STATE_ID));
request.respondAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class GetAttestations extends RestApiEndpoint {
public static final String ROUTE = "/eth/v1/beacon/pool/attestations";
private final NodeDataProvider nodeDataProvider;

public GetAttestations(final DataProvider dataProvider, Spec spec) {
public GetAttestations(final DataProvider dataProvider, final Spec spec) {
this(dataProvider.getNodeDataProvider(), spec);
}

Expand All @@ -61,7 +61,7 @@ public GetAttestations(final NodeDataProvider nodeDataProvider, final Spec spec)
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(Header.CACHE_CONTROL, CACHE_NONE);
final Optional<UInt64> slot =
request.getOptionalQueryParameter(SLOT_PARAMETER.withDescription(SLOT_QUERY_DESCRIPTION));
Expand All @@ -72,7 +72,7 @@ public void handleRequest(RestApiRequest request) throws JsonProcessingException
}

private static SerializableTypeDefinition<List<Attestation>> getResponseType(
SpecConfig specConfig) {
final SpecConfig specConfig) {
return SerializableTypeDefinition.<List<Attestation>>object()
.name("GetPoolAttestationsResponse")
.withField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public class GetAttesterSlashings extends RestApiEndpoint {
public static final String ROUTE = "/eth/v1/beacon/pool/attester_slashings";
private final NodeDataProvider nodeDataProvider;

public GetAttesterSlashings(final DataProvider dataProvider, Spec spec) {
public GetAttesterSlashings(final DataProvider dataProvider, final Spec spec) {
this(dataProvider.getNodeDataProvider(), spec);
}

GetAttesterSlashings(final NodeDataProvider provider, Spec spec) {
GetAttesterSlashings(final NodeDataProvider provider, final Spec spec) {
super(
EndpointMetadata.get(ROUTE)
.operationId("getPoolAttesterSlashings")
Expand All @@ -54,13 +54,14 @@ public GetAttesterSlashings(final DataProvider dataProvider, Spec spec) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(Header.CACHE_CONTROL, CACHE_NONE);
List<AttesterSlashing> attesterSlashings = nodeDataProvider.getAttesterSlashings();
request.respondOk(attesterSlashings);
}

private static SerializableTypeDefinition<List<AttesterSlashing>> getResponseType(Spec spec) {
private static SerializableTypeDefinition<List<AttesterSlashing>> getResponseType(
final Spec spec) {
final IndexedAttestation.IndexedAttestationSchema indexedAttestationSchema =
new IndexedAttestation.IndexedAttestationSchema(spec.getGenesisSpecConfig());
final AttesterSlashing.AttesterSlashingSchema attesterSlashingSchema =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public GetBlindedBlock(
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final SafeFuture<Optional<ObjectAndMetaData<SignedBeaconBlock>>> future =
chainDataProvider.getBlindedBlock(request.getPathParameter(PARAMETER_BLOCK_ID));

Expand All @@ -91,7 +91,7 @@ public void handleRequest(RestApiRequest request) throws JsonProcessingException
}

private static SerializableTypeDefinition<ObjectAndMetaData<SignedBeaconBlock>> getResponseType(
SchemaDefinitionCache schemaDefinitionCache) {
final SchemaDefinitionCache schemaDefinitionCache) {
final SerializableTypeDefinition<SignedBeaconBlock> signedBeaconBlockType =
getSchemaDefinitionForAllSupportedMilestones(
schemaDefinitionCache,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static EndpointMetadata createEndpointMetadata(final SchemaDefinitionCac
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final List<UInt64> indices = request.getQueryParameterList(BLOB_INDICES_PARAMETER);
final SafeFuture<Optional<List<BlobSidecar>>> future =
chainDataProvider.getBlobSidecars(request.getPathParameter(PARAMETER_BLOCK_ID), indices);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public class GetBlockAttestations extends RestApiEndpoint {
public static final String ROUTE = "/eth/v1/beacon/blocks/{block_id}/attestations";
private final ChainDataProvider chainDataProvider;

public GetBlockAttestations(final DataProvider dataProvider, Spec spec) {
public GetBlockAttestations(final DataProvider dataProvider, final Spec spec) {
this(dataProvider.getChainDataProvider(), spec);
}

public GetBlockAttestations(final ChainDataProvider chainDataProvider, Spec spec) {
public GetBlockAttestations(final ChainDataProvider chainDataProvider, final Spec spec) {
super(
EndpointMetadata.get(ROUTE)
.operationId("getBlockAttestations")
Expand All @@ -59,7 +59,7 @@ public GetBlockAttestations(final ChainDataProvider chainDataProvider, Spec spec
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final SafeFuture<Optional<ObjectAndMetaData<List<Attestation>>>> future =
chainDataProvider.getBlockAttestations(request.getPathParameter(PARAMETER_BLOCK_ID));

Expand All @@ -72,7 +72,7 @@ public void handleRequest(RestApiRequest request) throws JsonProcessingException
}

private static SerializableTypeDefinition<ObjectAndMetaData<List<Attestation>>> getResponseType(
Spec spec) {
final Spec spec) {
Attestation.AttestationSchema dataSchema =
new Attestation.AttestationSchema(spec.getGenesisSpecConfig());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public GetBlockHeader(final ChainDataProvider chainDataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final SafeFuture<Optional<BlockAndMetaData>> future =
chainDataProvider.getBlockAndMetaData(request.getPathParameter(PARAMETER_BLOCK_ID));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public GetBlockHeaders(final ChainDataProvider chainDataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final Optional<Bytes32> parentRoot = request.getOptionalQueryParameter(PARENT_ROOT_PARAMETER);
final Optional<UInt64> slot =
request.getOptionalQueryParameter(SLOT_PARAMETER.withDescription(SLOT_QUERY_DESCRIPTION));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public GetBlockRoot(final ChainDataProvider chainDataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final SafeFuture<Optional<ObjectAndMetaData<Bytes32>>> future =
chainDataProvider.getBlockRoot(request.getPathParameter(PARAMETER_BLOCK_ID));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private static EndpointMetadata createEndpointMetadata(final SchemaDefinitionCac
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(Header.CACHE_CONTROL, CACHE_NONE);
final Optional<Boolean> locallySubmitted =
request.getOptionalQueryParameter(LOCALLY_SUBMITTED_QUERY_PARAMETER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public class GetFinalizedBlockRoot extends RestApiEndpoint {
.withField("data", ROOT_TYPE, Function.identity())
.build();

public GetFinalizedBlockRoot(DataProvider dataProvider) {
public GetFinalizedBlockRoot(final DataProvider dataProvider) {
this(dataProvider.getChainDataProvider());
}

public GetFinalizedBlockRoot(ChainDataProvider chainDataProvider) {
public GetFinalizedBlockRoot(final ChainDataProvider chainDataProvider) {
super(
EndpointMetadata.get(ROUTE)
.operationId("getFinalizedBlockRoot")
Expand All @@ -64,7 +64,7 @@ public GetFinalizedBlockRoot(ChainDataProvider chainDataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final UInt64 slot = request.getPathParameter(SLOT_PARAMETER);
final SafeFuture<Optional<Bytes32>> futureFinalizedBlockRoot =
chainDataProvider.getFinalizedBlockRoot(slot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public class GetFinalizedCheckpointState extends RestApiEndpoint {
public static final String ROUTE = "/eth/v1/checkpoint/finalized_state";
private final ChainDataProvider chainDataProvider;

public GetFinalizedCheckpointState(final DataProvider dataProvider, Spec spec) {
public GetFinalizedCheckpointState(final DataProvider dataProvider, final Spec spec) {
this(dataProvider.getChainDataProvider(), spec);
}

public GetFinalizedCheckpointState(final ChainDataProvider chainDataProvider, Spec spec) {
public GetFinalizedCheckpointState(final ChainDataProvider chainDataProvider, final Spec spec) {
super(
EndpointMetadata.get(ROUTE)
.operationId("getFinalizedCheckpointState")
Expand All @@ -64,7 +64,7 @@ public GetFinalizedCheckpointState(final ChainDataProvider chainDataProvider, Sp
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final SafeFuture<Optional<StateAndMetaData>> future =
chainDataProvider.getBeaconStateAndMetadata("finalized");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private Optional<GenesisData> getGenesisData() {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final Optional<GenesisData> maybeData = getGenesisData();
if (maybeData.isEmpty()) {
request.respondWithCode(SC_NOT_FOUND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public GetProposerSlashings(final DataProvider dataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(Header.CACHE_CONTROL, CACHE_NONE);
List<ProposerSlashing> proposerSlashings = nodeDataProvider.getProposerSlashings();
request.respondOk(proposerSlashings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public GetStateCommittees(final DataProvider dataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final Optional<UInt64> epoch = request.getOptionalQueryParameter(EPOCH_PARAMETER);
final Optional<UInt64> committeeIndex = request.getOptionalQueryParameter(INDEX_PARAMETER);
final Optional<UInt64> slot =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public GetStateSyncCommittees(final ChainDataProvider chainDataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final Optional<UInt64> epoch = request.getOptionalQueryParameter(EPOCH_PARAMETER);
final SafeFuture<Optional<ObjectAndMetaData<StateSyncCommitteesData>>> future =
chainDataProvider.getStateSyncCommittees(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public GetStateValidator(final DataProvider dataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final SafeFuture<Optional<StateAndMetaData>> future =
chainDataProvider.getBeaconStateAndMetadata(request.getPathParameter(PARAMETER_STATE_ID));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public GetStateValidatorBalances(final DataProvider dataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final List<String> validators = request.getQueryParameterList(ID_PARAMETER);

final SafeFuture<Optional<ObjectAndMetaData<List<StateValidatorBalanceData>>>> future =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public GetStateValidators(final DataProvider dataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final List<String> validators = request.getQueryParameterList(ID_PARAMETER);
final List<StatusParameter> statusParameters = request.getQueryParameterList(STATUS_PARAMETER);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public GetVoluntaryExits(final DataProvider dataProvider) {
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
request.header(Header.CACHE_CONTROL, CACHE_NONE);
request.respondOk(nodeDataProvider.getVoluntaryExits());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public PostAttestation(
}

@Override
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
public void handleRequest(final RestApiRequest request) throws JsonProcessingException {
final List<Attestation> attestations = request.getRequestBody();
final SafeFuture<List<SubmitDataError>> future = provider.submitAttestations(attestations);

Expand Down
Loading

0 comments on commit 9973928

Please sign in to comment.