@Test public void onDepositsFromBlock_missingRangeOfEvents() { final DepositsFromBlockEvent event1 = dataStructureUtil.randomDepositsFromBlockEvent(UInt64.valueOf(10), 0, 10); final DepositsFromBlockEvent event3 = dataStructureUtil.randomDepositsFromBlockEvent(UInt64.valueOf(12), 15, 20); genesisHandler.onDepositsFromBlock(event1); assertThatThrownBy(() -> genesisHandler.onDepositsFromBlock(event3)) .isInstanceOf(InvalidDepositEventsException.class) .hasMessageContaining("Expected next deposit at index 10, but got 15"); }
@Override public void onDepositsFromBlock(final DepositsFromBlockEvent event) { if (!recentChainData.isPreGenesis()) { return; } LOG.trace( "Processing {} deposits from block {}", event.getDeposits().size(), event.getBlockNumber()); final List<DepositWithIndex> deposits = event.getDeposits().stream() .map(DepositUtil::convertDepositEventToOperationDeposit) .collect(Collectors.toList()); processNewData(event.getBlockHash(), event.getBlockTimestamp(), deposits); }
GenesisHandler implements Eth1EventsChannel { @Override public void onDepositsFromBlock(final DepositsFromBlockEvent event) { if (!recentChainData.isPreGenesis()) { return; } LOG.trace( "Processing {} deposits from block {}", event.getDeposits().size(), event.getBlockNumber()); final List<DepositWithIndex> deposits = event.getDeposits().stream() .map(DepositUtil::convertDepositEventToOperationDeposit) .collect(Collectors.toList()); processNewData(event.getBlockHash(), event.getBlockTimestamp(), deposits); } }
GenesisHandler implements Eth1EventsChannel { @Override public void onDepositsFromBlock(final DepositsFromBlockEvent event) { if (!recentChainData.isPreGenesis()) { return; } LOG.trace( "Processing {} deposits from block {}", event.getDeposits().size(), event.getBlockNumber()); final List<DepositWithIndex> deposits = event.getDeposits().stream() .map(DepositUtil::convertDepositEventToOperationDeposit) .collect(Collectors.toList()); processNewData(event.getBlockHash(), event.getBlockTimestamp(), deposits); } GenesisHandler(final RecentChainData recentChainData); }
GenesisHandler implements Eth1EventsChannel { @Override public void onDepositsFromBlock(final DepositsFromBlockEvent event) { if (!recentChainData.isPreGenesis()) { return; } LOG.trace( "Processing {} deposits from block {}", event.getDeposits().size(), event.getBlockNumber()); final List<DepositWithIndex> deposits = event.getDeposits().stream() .map(DepositUtil::convertDepositEventToOperationDeposit) .collect(Collectors.toList()); processNewData(event.getBlockHash(), event.getBlockTimestamp(), deposits); } GenesisHandler(final RecentChainData recentChainData); @Override void onDepositsFromBlock(final DepositsFromBlockEvent event); @Override void onMinGenesisTimeBlock(MinGenesisTimeBlockEvent event); }
GenesisHandler implements Eth1EventsChannel { @Override public void onDepositsFromBlock(final DepositsFromBlockEvent event) { if (!recentChainData.isPreGenesis()) { return; } LOG.trace( "Processing {} deposits from block {}", event.getDeposits().size(), event.getBlockNumber()); final List<DepositWithIndex> deposits = event.getDeposits().stream() .map(DepositUtil::convertDepositEventToOperationDeposit) .collect(Collectors.toList()); processNewData(event.getBlockHash(), event.getBlockTimestamp(), deposits); } GenesisHandler(final RecentChainData recentChainData); @Override void onDepositsFromBlock(final DepositsFromBlockEvent event); @Override void onMinGenesisTimeBlock(MinGenesisTimeBlockEvent event);  }