@Test void shouldBackfillEth1BlocksWhenFirstInSyncUntilBlockBeforeCachePeriodReached() { final Map<Integer, Block> blocks = withBlocks( block(100, timeProvider.getTimeInSeconds()), block(99, timeProvider.getTimeInSeconds().minus(ONE)), block(98, timeProvider.getTimeInSeconds().minus(CACHE_DURATION)), block(97, timeProvider.getTimeInSeconds().minus(CACHE_DURATION).minus(ONE)), block(96, timeProvider.getTimeInSeconds().minus(CACHE_DURATION).minus(TWO))); blockFetcher.onInSync(UInt64.valueOf(100)); verifyBlockSent(blocks.get(100)); verifyBlockSent(blocks.get(99)); verifyBlockSent(blocks.get(98)); verifyNoMoreBlocksSent(); verify(eth1Provider).getGuaranteedEth1Block(UInt64.valueOf(97)); verifyBlockNotRequested(96); }
public synchronized void onInSync(final UInt64 latestCanonicalBlockNumber) { if (active) { return; } active = true; LOG.debug("Beginning back-fill of Eth1 blocks"); backfillEth1Blocks(latestCanonicalBlockNumber); }
Eth1BlockFetcher { public synchronized void onInSync(final UInt64 latestCanonicalBlockNumber) { if (active) { return; } active = true; LOG.debug("Beginning back-fill of Eth1 blocks"); backfillEth1Blocks(latestCanonicalBlockNumber); } }
Eth1BlockFetcher { public synchronized void onInSync(final UInt64 latestCanonicalBlockNumber) { if (active) { return; } active = true; LOG.debug("Beginning back-fill of Eth1 blocks"); backfillEth1Blocks(latestCanonicalBlockNumber); } Eth1BlockFetcher(
      final Eth1EventsChannel eth1EventsChannel,
      final Eth1Provider eth1Provider,
      final TimeProvider timeProvider,
      final UInt64 cacheDuration); }
Eth1BlockFetcher { public synchronized void onInSync(final UInt64 latestCanonicalBlockNumber) { if (active) { return; } active = true; LOG.debug("Beginning back-fill of Eth1 blocks"); backfillEth1Blocks(latestCanonicalBlockNumber); } Eth1BlockFetcher(
      final Eth1EventsChannel eth1EventsChannel,
      final Eth1Provider eth1Provider,
      final TimeProvider timeProvider,
      final UInt64 cacheDuration); synchronized void onInSync(final UInt64 latestCanonicalBlockNumber); void fetch(final BigInteger fromBlock, final BigInteger toBlock); }
Eth1BlockFetcher { public synchronized void onInSync(final UInt64 latestCanonicalBlockNumber) { if (active) { return; } active = true; LOG.debug("Beginning back-fill of Eth1 blocks"); backfillEth1Blocks(latestCanonicalBlockNumber); } Eth1BlockFetcher(
      final Eth1EventsChannel eth1EventsChannel,
      final Eth1Provider eth1Provider,
      final TimeProvider timeProvider,
      final UInt64 cacheDuration); synchronized void onInSync(final UInt64 latestCanonicalBlockNumber); void fetch(final BigInteger fromBlock, final BigInteger toBlock);  }