Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-aouadi committed Jul 18, 2024
1 parent 40e32ca commit 7f7abcd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private static EndpointMetadata createMetadata(
+ "If an attestation is validated successfully, the node MUST publish that attestation on the appropriate subnet.\n"
+ "If one or more attestations fail validation, the node MUST return a 400 error with details of which attestations have failed, and why.")
.tags(TAG_BEACON, TAG_VALIDATOR_REQUIRED, TAG_EXPERIMENTAL)
.requestBodyTypeForList(
.requestBodyType(
SerializableTypeDefinition.listOf(attestationSchemaDefinition), attestationBodySelector)
.headerRequired(
ETH_CONSENSUS_VERSION_TYPE.withDescription(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import static com.google.common.base.Preconditions.checkArgument;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Predicate;
Expand Down Expand Up @@ -44,11 +43,6 @@ static <TObject> DeserializableOneOfTypeDefinitionBuilder<TObject> object() {
return new DeserializableOneOfTypeDefinitionBuilder<>();
}

static <TObject> DeserializableTypeDefinition<List<TObject>> listOf(
final DeserializableTypeDefinition<TObject> itemType) {
return new DeserializableListTypeDefinition<>(itemType, Optional.empty());
}

public DeserializableTypeDefinition<? extends TObject> getMatchingType(final String content) {
DeserializableTypeDefinition<? extends TObject> typeDefinition = null;
for (Predicate<String> predicate : parserTypes.keySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ public <T> EndpointMetaDataBuilder requestBodyType(
return this;
}

public <T> EndpointMetaDataBuilder requestBodyTypeForList(
public <T> EndpointMetaDataBuilder requestBodyType(
final SerializableTypeDefinition<List<T>> requestBodyType,
final OneOfArrayJsonRequestContentTypeDefinition.BodyTypeSelector<T> bodyTypeSelector) {
this.requestBodyTypes.put(
Expand Down

0 comments on commit 7f7abcd

Please sign in to comment.