use of tech.pegasys.teku.pow.Eth1HeadTracker.HeadUpdatedSubscriber in project teku by ConsenSys.
the class Eth1DepositManagerTest method notifyHeadBlock.
private void notifyHeadBlock(final BigInteger blockNumber, final long timestamp) {
final Block latestBlock = block(blockNumber, timestamp);
when(eth1Provider.getGuaranteedEth1Block(UInt64.valueOf(blockNumber))).thenReturn(SafeFuture.completedFuture(latestBlock));
final ArgumentCaptor<HeadUpdatedSubscriber> captor = ArgumentCaptor.forClass(HeadUpdatedSubscriber.class);
verify(eth1HeadTracker, atLeastOnce()).subscribe(captor.capture());
captor.getValue().onHeadUpdated(UInt64.valueOf(blockNumber));
}
use of tech.pegasys.teku.pow.Eth1HeadTracker.HeadUpdatedSubscriber in project teku by ConsenSys.
the class DepositProcessingControllerTest method pushLatestCanonicalBlockWithNumber.
private void pushLatestCanonicalBlockWithNumber(long latestBlockNumber) {
final ArgumentCaptor<HeadUpdatedSubscriber> captor = ArgumentCaptor.forClass(HeadUpdatedSubscriber.class);
verify(headTracker).subscribe(captor.capture());
final HeadUpdatedSubscriber subscriber = captor.getValue();
subscriber.onHeadUpdated(UInt64.valueOf(latestBlockNumber));
}
Aggregations