Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Mar 25, 2024
1 parent 3d35e74 commit 6e397ad
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
import org.junit.jupiter.params.provider.MethodSource;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.Spec;
import tech.pegasys.teku.spec.SpecMilestone;
import tech.pegasys.teku.spec.TestSpecFactory;
import tech.pegasys.teku.spec.config.SpecConfig;
import tech.pegasys.teku.spec.networks.Eth2Network;
import tech.pegasys.teku.spec.util.DataStructureUtil;

class MiscHelpersTest {
Expand Down Expand Up @@ -232,9 +234,17 @@ public void committeeComputationShouldNotOverflow(int activeValidatorsCount, int
}

@Test
public void isFormerDepositReceiptMechanismDisabled_returnsFalse() {
assertThat(miscHelpers.isFormerDepositMechanismDisabled(dataStructureUtil.randomBeaconState()))
.isFalse();
public void isFormerDepositReceiptMechanismDisabled_returnsFalseForAllForksPriorToElectra() {
SpecMilestone.getAllPriorMilestones(SpecMilestone.ELECTRA)
.forEach(
milestone -> {
final Spec spec = TestSpecFactory.create(milestone, Eth2Network.MINIMAL);
final MiscHelpers miscHelpers = spec.atSlot(UInt64.ZERO).miscHelpers();
assertThat(
miscHelpers.isFormerDepositMechanismDisabled(
dataStructureUtil.randomBeaconState()))
.isFalse();
});
}

public static Stream<Arguments> getComputesSlotAtTimeArguments() {
Expand Down

0 comments on commit 6e397ad

Please sign in to comment.