@Test public void onDepositsFromBlock_missingFirstEvent() { final DepositsFromBlockEvent event = dataStructureUtil.randomDepositsFromBlockEvent(UInt64.ONE, 1, 11); assertThatThrownBy(() -> genesisHandler.onDepositsFromBlock(event)) .isInstanceOf(InvalidDepositEventsException.class) .hasMessageContaining("Expected next deposit at index 0, but got 1"); }
@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);  }