Search in sources :

Example 1 with ForkAndSpecMilestone

use of tech.pegasys.teku.spec.datastructures.util.ForkAndSpecMilestone in project teku by ConsenSys.

the class ForkScheduleTest method getActiveMilestones_withTransition.

@Test
public void getActiveMilestones_withTransition() {
    final ForkSchedule forkSchedule = buildForkSchedule(TRANSITION_CONFIG);
    final Fork phase0Fork = getPhase0Fork(TRANSITION_CONFIG);
    final Fork altairFork = getAltairFork(TRANSITION_CONFIG);
    assertThat(forkSchedule.getActiveMilestones()).containsExactly(new ForkAndSpecMilestone(phase0Fork, SpecMilestone.PHASE0), new ForkAndSpecMilestone(altairFork, SpecMilestone.ALTAIR));
}
Also used : Fork(tech.pegasys.teku.spec.datastructures.state.Fork) ForkAndSpecMilestone(tech.pegasys.teku.spec.datastructures.util.ForkAndSpecMilestone) Test(org.junit.jupiter.api.Test)

Example 2 with ForkAndSpecMilestone

use of tech.pegasys.teku.spec.datastructures.util.ForkAndSpecMilestone in project teku by ConsenSys.

the class ForkScheduleTest method getActiveMilestones_onlyAltairConfigured.

@Test
public void getActiveMilestones_onlyAltairConfigured() {
    final ForkSchedule forkSchedule = buildForkSchedule(ALTAIR_CONFIG);
    final Fork altairFork = getAltairFork(ALTAIR_CONFIG);
    assertThat(forkSchedule.getActiveMilestones()).containsExactly(new ForkAndSpecMilestone(altairFork, SpecMilestone.ALTAIR));
}
Also used : Fork(tech.pegasys.teku.spec.datastructures.state.Fork) ForkAndSpecMilestone(tech.pegasys.teku.spec.datastructures.util.ForkAndSpecMilestone) Test(org.junit.jupiter.api.Test)

Example 3 with ForkAndSpecMilestone

use of tech.pegasys.teku.spec.datastructures.util.ForkAndSpecMilestone in project web3signer by ConsenSys.

the class Eth2CustomNetworkFileAcceptanceTest method signAndVerifyBlockV2SignatureForAllEnabledMilestones.

@Test
void signAndVerifyBlockV2SignatureForAllEnabledMilestones() throws Exception {
    final Spec spec = SpecFactory.create(NETWORK_CONFIG_PATH.toString());
    final List<ForkAndSpecMilestone> enabledMilestones = spec.getEnabledMilestones();
    assertThat(enabledMilestones.size()).isEqualTo(3);
    for (final ForkAndSpecMilestone forkAndSpecMilestone : enabledMilestones) {
        final Eth2SigningRequestBody request = createBlockV2SigningRequest(spec, forkAndSpecMilestone);
        final Bytes signingRootSignature = sendSignRequestAndReceiveSignature(request);
        final Bytes expectedSigningRootSignature = calculateSigningRootSignature(request.getSigningRoot());
        assertThat(signingRootSignature).isEqualTo(expectedSigningRootSignature);
    }
}
Also used : Bytes(org.apache.tuweni.bytes.Bytes) ForkAndSpecMilestone(tech.pegasys.teku.spec.datastructures.util.ForkAndSpecMilestone) Eth2SigningRequestBody(tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.Eth2SigningRequestBody) Spec(tech.pegasys.teku.spec.Spec) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)3 ForkAndSpecMilestone (tech.pegasys.teku.spec.datastructures.util.ForkAndSpecMilestone)3 Fork (tech.pegasys.teku.spec.datastructures.state.Fork)2 Bytes (org.apache.tuweni.bytes.Bytes)1 Spec (tech.pegasys.teku.spec.Spec)1 Eth2SigningRequestBody (tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.Eth2SigningRequestBody)1