Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsBellatrix;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsCapella;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsDeneb;
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsElectra;

@SuppressWarnings("JavaCase")
public enum SszObjectType {
Expand Down Expand Up @@ -70,6 +71,7 @@ public enum SszObjectType {
Deposit(new DepositSchema()),
AttestationData(new AttestationDataSchema()),
BeaconState(schemas(SchemaDefinitions::getBeaconStateSchema)),
SingleAttestation(electraSchemas(SchemaDefinitionsElectra::getSingleAttestationSchema)),
Attestation(schemas(SchemaDefinitions::getAttestationSchema)),
SignedVoluntaryExit(new SignedVoluntaryExitSchema()),
SyncCommitteeMessage(altairSchemas(SchemaDefinitionsAltair::getSyncCommitteeMessageSchema)),
Expand Down Expand Up @@ -136,6 +138,11 @@ private static Function<SpecVersion, SszSchema<?>> denebSchemas(
return spec -> getter.apply(SchemaDefinitionsDeneb.required(spec.getSchemaDefinitions()));
}

private static Function<SpecVersion, SszSchema<?>> electraSchemas(
final Function<SchemaDefinitionsElectra, SszSchema<?>> getter) {
return spec -> getter.apply(SchemaDefinitionsElectra.required(spec.getSchemaDefinitions()));
}

private static Function<SpecVersion, SszSchema<?>> config(
final Function<SpecConfig, SszSchema<?>> getter) {
return spec -> getter.apply(spec.getConfig());
Expand Down