use of co.rsk.net.handler.TxHandler in project rskj by rsksmart.
the class NodeMessageHandlerTest method processNewBlockHashesMessageDoesNothingBecauseNodeIsSyncing.
@Test
public void processNewBlockHashesMessageDoesNothingBecauseNodeIsSyncing() {
TxHandler txHandler = mock(TxHandler.class);
BlockProcessor blockProcessor = mock(BlockProcessor.class);
Mockito.when(blockProcessor.hasBetterBlockToSync()).thenReturn(true);
final NodeMessageHandler handler = new NodeMessageHandler(config, blockProcessor, null, null, null, txHandler, null, new ProofOfWorkRule(config).setFallbackMiningEnabled(false));
Message message = mock(Message.class);
Mockito.when(message.getMessageType()).thenReturn(MessageType.NEW_BLOCK_HASHES);
handler.processMessage(null, message);
verify(blockProcessor, never()).processNewBlockHashesMessage(any(), any());
}
Aggregations