Skip to content

Commit

Permalink
fix attester slashing schema
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-aouadi committed Mar 26, 2024
1 parent 7599e38 commit 9d1aefb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public abstract class AbstractSchemaDefinitions implements SchemaDefinitions {
SszBitvectorSchema.create(NetworkConstants.SYNC_COMMITTEE_SUBNET_COUNT);
private final HistoricalBatchSchema historicalBatchSchema;
private final SignedAggregateAndProofSchema signedAggregateAndProofSchema;
private final IndexedAttestationContainerSchema<IndexedAttestationContainer>
indexedAttestationContainerSchema;
private final IndexedAttestationSchema indexedAttestationSchema;
private final AttesterSlashingSchema attesterSlashingSchema;
private final BeaconBlocksByRootRequestMessage.BeaconBlocksByRootRequestMessageSchema
Expand All @@ -45,9 +47,9 @@ public AbstractSchemaDefinitions(final SpecConfig specConfig) {
this.beaconBlocksByRootRequestMessageSchema =
new BeaconBlocksByRootRequestMessage.BeaconBlocksByRootRequestMessageSchema(specConfig);
this.indexedAttestationSchema = new IndexedAttestationSchema(specConfig);
this.attesterSlashingSchema =
new AttesterSlashingSchema(
indexedAttestationSchema.castTypeToIndexedAttestationContainer());
this.indexedAttestationContainerSchema =
indexedAttestationSchema.castTypeToIndexedAttestationContainer();
this.attesterSlashingSchema = new AttesterSlashingSchema(indexedAttestationContainerSchema);
this.attnetsENRFieldSchema = SszBitvectorSchema.create(specConfig.getAttestationSubnetCount());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionPayloadSchemaElectra;
import tech.pegasys.teku.spec.datastructures.operations.AttestationContainer;
import tech.pegasys.teku.spec.datastructures.operations.AttestationContainerSchema;
import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing.AttesterSlashingSchema;
import tech.pegasys.teku.spec.datastructures.operations.IndexedAttestationContainer;
import tech.pegasys.teku.spec.datastructures.operations.IndexedAttestationContainerSchema;
import tech.pegasys.teku.spec.datastructures.operations.versions.electra.AttestationElectraSchema;
Expand Down Expand Up @@ -85,7 +84,6 @@ public class SchemaDefinitionsElectra extends SchemaDefinitionsDeneb {

private final AttestationElectraSchema attestationElectraSchema;
private final IndexedAttestationElectraSchema indexedAttestationElectraSchema;
private final AttesterSlashingSchema attesterSlashingSchema;

public SchemaDefinitionsElectra(final SpecConfigElectra specConfig) {
super(specConfig);
Expand Down Expand Up @@ -139,9 +137,6 @@ public SchemaDefinitionsElectra(final SpecConfigElectra specConfig) {
this.executionLayerExitSchema = ExecutionLayerExit.SSZ_SCHEMA;
this.attestationElectraSchema = new AttestationElectraSchema(specConfig);
this.indexedAttestationElectraSchema = new IndexedAttestationElectraSchema(specConfig);
this.attesterSlashingSchema =
new AttesterSlashingSchema(
indexedAttestationElectraSchema.castTypeToIndexedAttestationContainer());
}

public static SchemaDefinitionsElectra required(final SchemaDefinitions schemaDefinitions) {
Expand Down Expand Up @@ -219,11 +214,6 @@ public IndexedAttestationElectraSchema getIndexedAttestationElectraSchema() {
return indexedAttestationElectraSchema.castTypeToIndexedAttestationContainer();
}

@Override
public AttesterSlashingSchema getAttesterSlashingSchema() {
return attesterSlashingSchema;
}

@Override
public AttestationContainerSchema<AttestationContainer> getAttestationContainerSchema() {
return getAttestationElectraSchema().castTypeToAttestationContainer();
Expand Down

0 comments on commit 9d1aefb

Please sign in to comment.