Search in sources :

Example 21 with AttesterDuties

use of tech.pegasys.teku.validator.api.AttesterDuties in project teku by ConsenSys.

the class AttestationDutyLoaderTest method shouldSendSubscriptionRequestsWhenAllDutiesAreScheduled.

@Test
void shouldSendSubscriptionRequestsWhenAllDutiesAreScheduled() {
    when(validatorApiChannel.getAttestationDuties(UInt64.ONE, VALIDATOR_INDICES)).thenReturn(SafeFuture.completedFuture(Optional.of(new AttesterDuties(dataStructureUtil.randomBytes32(), emptyList()))));
    final SafeFuture<Optional<SlotBasedScheduledDuties<?, ?>>> result = dutyLoader.loadDutiesForEpoch(UInt64.ONE);
    assertThat(result).isCompleted();
    verify(beaconCommitteeSubscriptions).sendRequests();
}
Also used : AttesterDuties(tech.pegasys.teku.validator.api.AttesterDuties) Optional(java.util.Optional) Test(org.junit.jupiter.api.Test)

Aggregations

AttesterDuties (tech.pegasys.teku.validator.api.AttesterDuties)21 Test (org.junit.jupiter.api.Test)18 Optional (java.util.Optional)12 AttesterDuty (tech.pegasys.teku.validator.api.AttesterDuty)12 UInt64 (tech.pegasys.teku.infrastructure.unsigned.UInt64)11 BeaconState (tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState)5 AttestationProductionDuty (tech.pegasys.teku.validator.client.duties.attestations.AttestationProductionDuty)5 Bytes32 (org.apache.tuweni.bytes.Bytes32)4 BLSPublicKey (tech.pegasys.teku.bls.BLSPublicKey)4 SafeFuture (tech.pegasys.teku.infrastructure.async.SafeFuture)3 PostAttesterDutiesResponse (tech.pegasys.teku.api.response.v1.validator.PostAttesterDutiesResponse)2 BLSSignature (tech.pegasys.teku.bls.BLSSignature)2 CommitteeSubscriptionRequest (tech.pegasys.teku.validator.api.CommitteeSubscriptionRequest)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 IntCollection (it.unimi.dsi.fastutil.ints.IntCollection)1 IntSet (it.unimi.dsi.fastutil.ints.IntSet)1 IntSets (it.unimi.dsi.fastutil.ints.IntSets)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1