@Test public void setLastestPublishedDeposit_setTwice() { publisher.setLatestPublishedDeposit(UInt64.ZERO); assertThatThrownBy(() -> publisher.setLatestPublishedDeposit(UInt64.ONE)) .isInstanceOf(IllegalStateException.class) .hasMessageContaining("Latest published deposit is already set"); }
public synchronized void setLatestPublishedDeposit(final UInt64 latestPublishedDeposit) { checkNotNull(latestPublishedDeposit); if (!lastPublishedDeposit.isEmpty()) { throw new IllegalStateException("Latest published deposit is already set"); } this.lastPublishedDeposit = Optional.of(latestPublishedDeposit); }
ValidatingEth1EventsPublisher extends DelegatingEth1EventsChannel { public synchronized void setLatestPublishedDeposit(final UInt64 latestPublishedDeposit) { checkNotNull(latestPublishedDeposit); if (!lastPublishedDeposit.isEmpty()) { throw new IllegalStateException("Latest published deposit is already set"); } this.lastPublishedDeposit = Optional.of(latestPublishedDeposit); } }
ValidatingEth1EventsPublisher extends DelegatingEth1EventsChannel { public synchronized void setLatestPublishedDeposit(final UInt64 latestPublishedDeposit) { checkNotNull(latestPublishedDeposit); if (!lastPublishedDeposit.isEmpty()) { throw new IllegalStateException("Latest published deposit is already set"); } this.lastPublishedDeposit = Optional.of(latestPublishedDeposit); } ValidatingEth1EventsPublisher(final Eth1EventsChannel delegate); }
ValidatingEth1EventsPublisher extends DelegatingEth1EventsChannel { public synchronized void setLatestPublishedDeposit(final UInt64 latestPublishedDeposit) { checkNotNull(latestPublishedDeposit); if (!lastPublishedDeposit.isEmpty()) { throw new IllegalStateException("Latest published deposit is already set"); } this.lastPublishedDeposit = Optional.of(latestPublishedDeposit); } ValidatingEth1EventsPublisher(final Eth1EventsChannel delegate); synchronized void setLatestPublishedDeposit(final UInt64 latestPublishedDeposit); @Override synchronized void onDepositsFromBlock(final DepositsFromBlockEvent event); }
ValidatingEth1EventsPublisher extends DelegatingEth1EventsChannel { public synchronized void setLatestPublishedDeposit(final UInt64 latestPublishedDeposit) { checkNotNull(latestPublishedDeposit); if (!lastPublishedDeposit.isEmpty()) { throw new IllegalStateException("Latest published deposit is already set"); } this.lastPublishedDeposit = Optional.of(latestPublishedDeposit); } ValidatingEth1EventsPublisher(final Eth1EventsChannel delegate); synchronized void setLatestPublishedDeposit(final UInt64 latestPublishedDeposit); @Override synchronized void onDepositsFromBlock(final DepositsFromBlockEvent event);  }