Skip to content

Commit 8ccee7b

Browse files
committed
Remove implementation from PR
1 parent 22d4edf commit 8ccee7b

File tree

3 files changed

+4
-166
lines changed

3 files changed

+4
-166
lines changed

Diff for: validator/client/src/main/java/tech/pegasys/teku/validator/client/restapi/ValidatorRestApi.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public static RestApi create(
130130
.endpoint(new DeleteFeeRecipient(proposerConfigManager))
131131
.endpoint(new DeleteGasLimit(proposerConfigManager))
132132
.endpoint(new PostVoluntaryExit(voluntaryExitDataProvider))
133-
.endpoint(new GetGraffiti(keyManager))
133+
.endpoint(new GetGraffiti())
134134
.sslCertificate(config.getRestApiKeystoreFile(), config.getRestApiKeystorePasswordFile())
135135
.passwordFilePath(validatorApiBearerFile)
136136
.build();

Diff for: validator/client/src/main/java/tech/pegasys/teku/validator/client/restapi/apis/GetGraffiti.java

+3-22
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,24 @@
1313

1414
package tech.pegasys.teku.validator.client.restapi.apis;
1515

16-
import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_NOT_FOUND;
1716
import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_OK;
1817
import static tech.pegasys.teku.infrastructure.json.types.CoreTypes.STRING_TYPE;
1918
import static tech.pegasys.teku.validator.client.restapi.ValidatorRestApi.TAG_GRAFFITI;
2019
import static tech.pegasys.teku.validator.client.restapi.ValidatorTypes.PARAM_PUBKEY_TYPE;
2120

2221
import com.fasterxml.jackson.core.JsonProcessingException;
23-
import java.nio.charset.StandardCharsets;
2422
import java.util.Objects;
2523
import java.util.Optional;
2624
import java.util.function.Function;
27-
import org.apache.tuweni.bytes.Bytes32;
25+
import org.apache.commons.lang3.NotImplementedException;
2826
import tech.pegasys.teku.bls.BLSPublicKey;
2927
import tech.pegasys.teku.infrastructure.json.types.SerializableTypeDefinition;
3028
import tech.pegasys.teku.infrastructure.restapi.endpoints.EndpointMetadata;
3129
import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiEndpoint;
3230
import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiRequest;
33-
import tech.pegasys.teku.validator.client.KeyManager;
34-
import tech.pegasys.teku.validator.client.Validator;
3531

3632
public class GetGraffiti extends RestApiEndpoint {
3733
public static final String ROUTE = "/eth/v1/validator/{pubkey}/graffiti";
38-
private final KeyManager keyManager;
3934

4035
private static final SerializableTypeDefinition<GraffitiResponse> GRAFFITI_TYPE =
4136
SerializableTypeDefinition.object(GraffitiResponse.class)
@@ -49,7 +44,7 @@ public class GetGraffiti extends RestApiEndpoint {
4944
.withField("data", GRAFFITI_TYPE, Function.identity())
5045
.build();
5146

52-
public GetGraffiti(final KeyManager keyManager) {
47+
public GetGraffiti() {
5348
super(
5449
EndpointMetadata.get(ROUTE)
5550
.operationId("getGraffiti")
@@ -63,25 +58,11 @@ public GetGraffiti(final KeyManager keyManager) {
6358
.withAuthenticationResponses()
6459
.withNotFoundResponse()
6560
.build());
66-
this.keyManager = keyManager;
6761
}
6862

6963
@Override
7064
public void handleRequest(RestApiRequest request) throws JsonProcessingException {
71-
final BLSPublicKey publicKey = request.getPathParameter(PARAM_PUBKEY_TYPE);
72-
73-
final Optional<Validator> maybeValidator = keyManager.getValidatorByPublicKey(publicKey);
74-
if (maybeValidator.isEmpty()) {
75-
request.respondError(SC_NOT_FOUND, "Validator not found");
76-
return;
77-
}
78-
79-
String graffiti = maybeValidator.get().getGraffiti().map(this::processGraffitiBytes).orElse("");
80-
request.respondOk(new GraffitiResponse(publicKey, graffiti));
81-
}
82-
83-
private String processGraffitiBytes(final Bytes32 graffiti) {
84-
return new String(graffiti.toArrayUnsafe(), StandardCharsets.UTF_8).strip().replace("\0", "");
65+
throw new NotImplementedException("Not implemented");
8566
}
8667

8768
static class GraffitiResponse {

Diff for: validator/client/src/test/java/tech/pegasys/teku/validator/client/restapi/apis/GetGraffitiTest.java

-143
This file was deleted.

0 commit comments

Comments
 (0)