@Test public void shouldNotPerformDutiesForSameSlotTwice() { final UInt64 blockProposerSlot = UInt64.valueOf(5); final ValidatorDuties validator1Duties = ValidatorDuties.withDuties( VALIDATOR1_KEY, 5, 3, 6, 0, List.of(blockProposerSlot), UInt64.valueOf(7)); when(validatorApiChannel.getDuties(eq(ZERO), any())) .thenReturn(completedFuture(Optional.of(List.of(validator1Duties)))); final BlockProductionDuty blockCreationDuty = mock(BlockProductionDuty.class); when(blockCreationDuty.performDuty()).thenReturn(new SafeFuture<>()); when(dutyFactory.createBlockProductionDuty(blockProposerSlot, validator1)) .thenReturn(blockCreationDuty); dutyScheduler.onSlot(compute_start_slot_at_epoch(ZERO)); dutyScheduler.onBlockProductionDue(blockProposerSlot); verify(blockCreationDuty).performDuty(); dutyScheduler.onBlockProductionDue(blockProposerSlot); verifyNoMoreInteractions(blockCreationDuty); }
@Override public void onBlockProductionDue(final UInt64 slot) { notifyDutyQueue(DutyQueue::onBlockProductionDue, slot); }
BlockDutyScheduler extends AbstractDutyScheduler { @Override public void onBlockProductionDue(final UInt64 slot) { notifyDutyQueue(DutyQueue::onBlockProductionDue, slot); } }
BlockDutyScheduler extends AbstractDutyScheduler { @Override public void onBlockProductionDue(final UInt64 slot) { notifyDutyQueue(DutyQueue::onBlockProductionDue, slot); } BlockDutyScheduler(
      final MetricsSystem metricsSystem, final DutyLoader epochDutiesScheduler); }
BlockDutyScheduler extends AbstractDutyScheduler { @Override public void onBlockProductionDue(final UInt64 slot) { notifyDutyQueue(DutyQueue::onBlockProductionDue, slot); } BlockDutyScheduler(
      final MetricsSystem metricsSystem, final DutyLoader epochDutiesScheduler); @Override void onBlockProductionDue(final UInt64 slot); }
BlockDutyScheduler extends AbstractDutyScheduler { @Override public void onBlockProductionDue(final UInt64 slot) { notifyDutyQueue(DutyQueue::onBlockProductionDue, slot); } BlockDutyScheduler(
      final MetricsSystem metricsSystem, final DutyLoader epochDutiesScheduler); @Override void onBlockProductionDue(final UInt64 slot);  }