@Test public void onDepositsFromBlock_noLatestIndexSet_depositsAfterZero() { final DepositsFromBlockEvent event2 = dataStructureUtil.randomDepositsFromBlockEvent(2, 10, 11); assertThatThrownBy(() -> publisher.onDepositsFromBlock(event2)) .isInstanceOf(InvalidDepositEventsException.class) .hasMessageContaining("Expected next deposit at index 0, but got 10"); }
@Override public synchronized void onDepositsFromBlock(final DepositsFromBlockEvent event) { LOG.trace( "Process deposits {} - {}", event.getFirstDepositIndex(), event.getLastDepositIndex()); assertDepositEventIsValid(event); lastPublishedDeposit = Optional.of(event.getLastDepositIndex()); delegate.onDepositsFromBlock(event); }
ValidatingEth1EventsPublisher extends DelegatingEth1EventsChannel { @Override public synchronized void onDepositsFromBlock(final DepositsFromBlockEvent event) { LOG.trace( "Process deposits {} - {}", event.getFirstDepositIndex(), event.getLastDepositIndex()); assertDepositEventIsValid(event); lastPublishedDeposit = Optional.of(event.getLastDepositIndex()); delegate.onDepositsFromBlock(event); } }
ValidatingEth1EventsPublisher extends DelegatingEth1EventsChannel { @Override public synchronized void onDepositsFromBlock(final DepositsFromBlockEvent event) { LOG.trace( "Process deposits {} - {}", event.getFirstDepositIndex(), event.getLastDepositIndex()); assertDepositEventIsValid(event); lastPublishedDeposit = Optional.of(event.getLastDepositIndex()); delegate.onDepositsFromBlock(event); } ValidatingEth1EventsPublisher(final Eth1EventsChannel delegate); }
ValidatingEth1EventsPublisher extends DelegatingEth1EventsChannel { @Override public synchronized void onDepositsFromBlock(final DepositsFromBlockEvent event) { LOG.trace( "Process deposits {} - {}", event.getFirstDepositIndex(), event.getLastDepositIndex()); assertDepositEventIsValid(event); lastPublishedDeposit = Optional.of(event.getLastDepositIndex()); delegate.onDepositsFromBlock(event); } ValidatingEth1EventsPublisher(final Eth1EventsChannel delegate); synchronized void setLatestPublishedDeposit(final UInt64 latestPublishedDeposit); @Override synchronized void onDepositsFromBlock(final DepositsFromBlockEvent event); }
ValidatingEth1EventsPublisher extends DelegatingEth1EventsChannel { @Override public synchronized void onDepositsFromBlock(final DepositsFromBlockEvent event) { LOG.trace( "Process deposits {} - {}", event.getFirstDepositIndex(), event.getLastDepositIndex()); assertDepositEventIsValid(event); lastPublishedDeposit = Optional.of(event.getLastDepositIndex()); delegate.onDepositsFromBlock(event); } ValidatingEth1EventsPublisher(final Eth1EventsChannel delegate); synchronized void setLatestPublishedDeposit(final UInt64 latestPublishedDeposit); @Override synchronized void onDepositsFromBlock(final DepositsFromBlockEvent event);  }