@Test public void getCurrentSlot_shouldGetZeroPriorToGenesis() { assertThat(ForkChoiceUtil.getCurrentSlot(GENESIS_TIME.minus(1), GENESIS_TIME)) .isEqualTo(UInt64.ZERO); }
public static UInt64 getCurrentSlot(UInt64 currentTime, UInt64 genesisTime) { if (currentTime.isLessThan(genesisTime)) { return UInt64.ZERO; } return currentTime.minus(genesisTime).dividedBy(SECONDS_PER_SLOT); }
ForkChoiceUtil { public static UInt64 getCurrentSlot(UInt64 currentTime, UInt64 genesisTime) { if (currentTime.isLessThan(genesisTime)) { return UInt64.ZERO; } return currentTime.minus(genesisTime).dividedBy(SECONDS_PER_SLOT); } }
ForkChoiceUtil { public static UInt64 getCurrentSlot(UInt64 currentTime, UInt64 genesisTime) { if (currentTime.isLessThan(genesisTime)) { return UInt64.ZERO; } return currentTime.minus(genesisTime).dividedBy(SECONDS_PER_SLOT); }  }
ForkChoiceUtil { public static UInt64 getCurrentSlot(UInt64 currentTime, UInt64 genesisTime) { if (currentTime.isLessThan(genesisTime)) { return UInt64.ZERO; } return currentTime.minus(genesisTime).dividedBy(SECONDS_PER_SLOT); }  static UInt64 get_slots_since_genesis(ReadOnlyStore store, boolean useUnixTime); static UInt64 getCurrentSlot(UInt64 currentTime, UInt64 genesisTime); static UInt64 getSlotStartTime(UInt64 slotNumber, UInt64 genesisTime); static UInt64 get_current_slot(ReadOnlyStore store, boolean useUnixTime); static UInt64 get_current_slot(ReadOnlyStore store); static UInt64 compute_slots_since_epoch_start(UInt64 slot); static Optional<Bytes32> get_ancestor(
      ForkChoiceStrategy forkChoiceStrategy, Bytes32 root, UInt64 slot); static NavigableMap<UInt64, Bytes32> getAncestors(
      ForkChoiceStrategy forkChoiceStrategy,
      Bytes32 root,
      UInt64 startSlot,
      UInt64 step,
      UInt64 count); static NavigableMap<UInt64, Bytes32> getAncestorsOnFork(
      ForkChoiceStrategy forkChoiceStrategy, Bytes32 root, UInt64 startSlot); static void on_tick(MutableStore store, UInt64 time); @CheckReturnValue static BlockImportResult on_block(
      final MutableStore store,
      final SignedBeaconBlock signed_block,
      Optional<BeaconState> maybePreState,
      final StateTransition st,
      final ForkChoiceStrategy forkChoiceStrategy,
      final Consumer<BeaconState> beaconStateConsumer,
      final IndexedAttestationProvider indexedAttestationProvider); static boolean blockDescendsFromLatestFinalizedBlock(
      final BeaconBlock block,
      final ReadOnlyStore store,
      final ForkChoiceStrategy forkChoiceStrategy); @CheckReturnValue static AttestationProcessingResult on_attestation(
      final MutableStore store,
      final ValidateableAttestation validateableAttestation,
      final Optional<BeaconState> maybeTargetState,
      final ForkChoiceStrategy forkChoiceStrategy); }
ForkChoiceUtil { public static UInt64 getCurrentSlot(UInt64 currentTime, UInt64 genesisTime) { if (currentTime.isLessThan(genesisTime)) { return UInt64.ZERO; } return currentTime.minus(genesisTime).dividedBy(SECONDS_PER_SLOT); }  static UInt64 get_slots_since_genesis(ReadOnlyStore store, boolean useUnixTime); static UInt64 getCurrentSlot(UInt64 currentTime, UInt64 genesisTime); static UInt64 getSlotStartTime(UInt64 slotNumber, UInt64 genesisTime); static UInt64 get_current_slot(ReadOnlyStore store, boolean useUnixTime); static UInt64 get_current_slot(ReadOnlyStore store); static UInt64 compute_slots_since_epoch_start(UInt64 slot); static Optional<Bytes32> get_ancestor(
      ForkChoiceStrategy forkChoiceStrategy, Bytes32 root, UInt64 slot); static NavigableMap<UInt64, Bytes32> getAncestors(
      ForkChoiceStrategy forkChoiceStrategy,
      Bytes32 root,
      UInt64 startSlot,
      UInt64 step,
      UInt64 count); static NavigableMap<UInt64, Bytes32> getAncestorsOnFork(
      ForkChoiceStrategy forkChoiceStrategy, Bytes32 root, UInt64 startSlot); static void on_tick(MutableStore store, UInt64 time); @CheckReturnValue static BlockImportResult on_block(
      final MutableStore store,
      final SignedBeaconBlock signed_block,
      Optional<BeaconState> maybePreState,
      final StateTransition st,
      final ForkChoiceStrategy forkChoiceStrategy,
      final Consumer<BeaconState> beaconStateConsumer,
      final IndexedAttestationProvider indexedAttestationProvider); static boolean blockDescendsFromLatestFinalizedBlock(
      final BeaconBlock block,
      final ReadOnlyStore store,
      final ForkChoiceStrategy forkChoiceStrategy); @CheckReturnValue static AttestationProcessingResult on_attestation(
      final MutableStore store,
      final ValidateableAttestation validateableAttestation,
      final Optional<BeaconState> maybeTargetState,
      final ForkChoiceStrategy forkChoiceStrategy);  }