Skip to content

Commit

Permalink
Removing PendingBalanceDeposit container
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassaldanha committed Oct 7, 2024
1 parent 651bf05 commit 8df717d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 151 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.electra.BeaconStateElectra;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.electra.BeaconStateSchemaElectra;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.electra.MutableBeaconStateElectra;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingBalanceDeposit;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingConsolidation;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingDeposit;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingPartialWithdrawal;
Expand Down Expand Up @@ -97,7 +96,6 @@ public class SchemaDefinitionsElectra extends SchemaDefinitionsDeneb {
private final WithdrawalRequestSchema withdrawalRequestSchema;
private final ConsolidationRequestSchema consolidationRequestSchema;

private final PendingBalanceDeposit.PendingBalanceDepositSchema pendingBalanceDepositSchema;
private final PendingDeposit.PendingDepositSchema pendingDepositSchema;

private final PendingPartialWithdrawal.PendingPartialWithdrawalSchema
Expand Down Expand Up @@ -171,7 +169,6 @@ public SchemaDefinitionsElectra(final SchemaRegistry schemaRegistry) {
this.depositRequestSchema = DepositRequest.SSZ_SCHEMA;
this.withdrawalRequestSchema = WithdrawalRequest.SSZ_SCHEMA;
this.consolidationRequestSchema = ConsolidationRequest.SSZ_SCHEMA;
this.pendingBalanceDepositSchema = new PendingBalanceDeposit.PendingBalanceDepositSchema();
this.pendingDepositSchema = new PendingDeposit.PendingDepositSchema();
this.pendingPartialWithdrawalSchema =
new PendingPartialWithdrawal.PendingPartialWithdrawalSchema();
Expand Down Expand Up @@ -320,10 +317,6 @@ public WithdrawalRequestSchema getWithdrawalRequestSchema() {
return withdrawalRequestSchema;
}

public PendingBalanceDeposit.PendingBalanceDepositSchema getPendingBalanceDepositSchema() {
return pendingBalanceDepositSchema;
}

public PendingDeposit.PendingDepositSchema getPendingDepositSchema() {
return pendingDepositSchema;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,21 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import net.jqwik.api.ForAll;
import net.jqwik.api.Property;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingBalanceDeposit;
import tech.pegasys.teku.spec.propertytest.suppliers.state.PendingBalanceDepositSupplier;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingDeposit;
import tech.pegasys.teku.spec.propertytest.suppliers.state.PendingDepositSupplier;

public class PendingBalanceDepositPropertyTest {
public class PendingDepositPropertyTest {
@Property
void roundTrip(
@ForAll(supplier = PendingBalanceDepositSupplier.class)
final PendingBalanceDeposit pendingBalanceDeposit)
@ForAll(supplier = PendingDepositSupplier.class) final PendingDeposit pendingDeposit)
throws JsonProcessingException {
assertRoundTrip(pendingBalanceDeposit);
assertRoundTrip(pendingDeposit);
}

@Property
void deserializeMutated(
@ForAll(supplier = PendingBalanceDepositSupplier.class)
final PendingBalanceDeposit pendingBalanceDeposit,
@ForAll(supplier = PendingDepositSupplier.class) final PendingDeposit pendingDeposit,
@ForAll final int seed) {
assertDeserializeMutatedThrowsExpected(pendingBalanceDeposit, seed);
assertDeserializeMutatedThrowsExpected(pendingDeposit, seed);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
package tech.pegasys.teku.spec.propertytest.suppliers.state;

import tech.pegasys.teku.spec.SpecMilestone;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingBalanceDeposit;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingDeposit;
import tech.pegasys.teku.spec.propertytest.suppliers.DataStructureUtilSupplier;
import tech.pegasys.teku.spec.util.DataStructureUtil;

public class PendingBalanceDepositSupplier
extends DataStructureUtilSupplier<PendingBalanceDeposit> {
public PendingBalanceDepositSupplier() {
super(DataStructureUtil::randomPendingBalanceDeposit, SpecMilestone.ELECTRA);
public class PendingDepositSupplier extends DataStructureUtilSupplier<PendingDeposit> {
public PendingDepositSupplier() {
super(DataStructureUtil::randomPendingDeposit, SpecMilestone.ELECTRA);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.altair.BeaconStateSchemaAltair;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.phase0.BeaconStateSchemaPhase0;
import tech.pegasys.teku.spec.datastructures.state.versions.capella.HistoricalSummary;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingBalanceDeposit;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingConsolidation;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingDeposit;
import tech.pegasys.teku.spec.datastructures.state.versions.electra.PendingPartialWithdrawal;
import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment;
import tech.pegasys.teku.spec.datastructures.type.SszKZGProof;
Expand Down Expand Up @@ -2531,10 +2531,15 @@ public WithdrawalRequest withdrawalRequest(final Validator validator, final UInt
.create(executionAddress, validator.getPublicKey(), amount);
}

public PendingBalanceDeposit randomPendingBalanceDeposit() {
public PendingDeposit randomPendingDeposit() {
return getElectraSchemaDefinitions(randomSlot())
.getPendingBalanceDepositSchema()
.create(SszUInt64.of(randomUInt64()), SszUInt64.of(randomUInt64()));
.getPendingDepositSchema()
.create(
randomSszPublicKey(),
SszBytes32.of(randomEth1WithdrawalCredentials()),
SszUInt64.of(randomUInt64()),
randomSszSignature(),
SszUInt64.of(randomUInt64()));
}

public ConsolidationRequest randomConsolidationRequest() {
Expand Down

0 comments on commit 8df717d

Please sign in to comment.