@Test public void onDepositsFromBlock_inOrder() { final DepositsFromBlockEvent event1 = dataStructureUtil.randomDepositsFromBlockEvent(1, 0, 10); final DepositsFromBlockEvent event2 = dataStructureUtil.randomDepositsFromBlockEvent(2, 10, 11); final DepositsFromBlockEvent event3 = dataStructureUtil.randomDepositsFromBlockEvent(3, 11, 15); publisher.onDepositsFromBlock(event1); verify(delegate).onDepositsFromBlock(event1); publisher.onDepositsFromBlock(event2); verify(delegate).onDepositsFromBlock(event2); publisher.onDepositsFromBlock(event3); verify(delegate).onDepositsFromBlock(event3); }
@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);  }