Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenr committed Nov 13, 2024
1 parent 45075b9 commit 464bcfb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void vectorLengthsTest() {

@Test
public void changeSpecConfigTest() {
final Spec standardSpec = TestSpecFactory.createMinimalPhase0();
final Spec standardSpec = TestSpecFactory.createMinimal(genesisConfig.getMilestone());
final SpecConfig modifiedConfig =
SpecConfigLoader.loadConfig(
"minimal",
Expand Down Expand Up @@ -110,9 +110,11 @@ void roundTripViaSsz() {
@Test
public void create_compareDifferentSpecs() {
final BeaconStateSchema<T, TMutable> minimalState =
getSchema(TestSpecFactory.createMinimalPhase0().getGenesisSpecConfig());
getSchema(
TestSpecFactory.createMinimal(genesisConfig.getMilestone()).getGenesisSpecConfig());
final BeaconStateSchema<T, TMutable> mainnetState =
getSchema(TestSpecFactory.createMainnetPhase0().getGenesisSpecConfig());
getSchema(
TestSpecFactory.createMainnet(genesisConfig.getMilestone()).getGenesisSpecConfig());

assertThat(minimalState).isNotEqualTo(mainnetState);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected BeaconStateAltair randomState() {

@Test
public void changeSpecConfigTest_checkAltairFields() {
final Spec standardSpec = TestSpecFactory.createMinimalPhase0();
final Spec standardSpec = TestSpecFactory.createMinimalAltair();
final SpecConfig modifiedConstants =
SpecConfigLoader.loadConfig("minimal", b -> b.validatorRegistryLimit(123L)).specConfig();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
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.datastructures.blocks.BlockCheckpoints;
import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock;
Expand All @@ -53,7 +54,7 @@ class ForkChoiceUtilTest {

private static final UInt64 GENESIS_TIME = UInt64.valueOf("1591924193");
private static final UInt64 GENESIS_TIME_MILLIS = GENESIS_TIME.times(1000L);
private final Spec spec = TestSpecFactory.createMinimalPhase0();
private final Spec spec = TestSpecFactory.createMinimalBellatrix();
private final DataStructureUtil dataStructureUtil = new DataStructureUtil(spec);
private final RandomChainBuilder chainBuilder = new RandomChainBuilder(dataStructureUtil);
private final RandomChainBuilderForkChoiceStrategy forkChoiceStrategy =
Expand Down Expand Up @@ -396,7 +397,8 @@ private ReadOnlyStore mockStore(
}

private int getSafeSyncDistance() {
return spec.getGenesisSpecConfig()
return spec.forMilestone(SpecMilestone.BELLATRIX)
.getConfig()
.toVersionBellatrix()
.orElseThrow()
.getSafeSlotsToImportOptimistically();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import tech.pegasys.teku.infrastructure.async.SafeFuture;
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.SpecConfigAltair;
import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.SyncAggregate;
Expand All @@ -47,7 +48,8 @@ class SyncCommitteeContributionPoolTest {
private final Spec spec = TestSpecFactory.createMinimalWithAltairForkEpoch(forkEpoch);
private final UInt64 forkSlot = spec.computeStartSlotAtEpoch(forkEpoch);
private final UInt64 altairSlot = forkSlot.plus(2);
private final SpecConfigAltair config = SpecConfigAltair.required(spec.getGenesisSpecConfig());
private final SpecConfigAltair config =
SpecConfigAltair.required(spec.forMilestone(SpecMilestone.ALTAIR).getConfig());
private final DataStructureUtil dataStructureUtil = new DataStructureUtil(spec);

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 464bcfb

Please sign in to comment.