use of co.rsk.net.simples.SimpleBlockProcessor in project rskj by rsksmart.
the class Web3ImplTest method eth_syncing_returnFalseWhenNotSyncing.
@Test
public void eth_syncing_returnFalseWhenNotSyncing() {
World world = new World();
SimpleBlockProcessor nodeProcessor = new SimpleBlockProcessor();
nodeProcessor.lastKnownBlockNumber = 0;
Web3Impl web3 = createWeb3(world, nodeProcessor, null);
Object result = web3.eth_syncing();
Assert.assertTrue("Node is not syncing, must return false", !(boolean) result);
}
use of co.rsk.net.simples.SimpleBlockProcessor in project rskj by rsksmart.
the class Web3ImplTest method eth_syncing_returnSyncingResultWhenSyncing.
@Test
public void eth_syncing_returnSyncingResultWhenSyncing() {
World world = new World();
SimpleBlockProcessor nodeProcessor = new SimpleBlockProcessor();
nodeProcessor.lastKnownBlockNumber = 5;
Web3Impl web3 = createWeb3(world, nodeProcessor, null);
Object result = web3.eth_syncing();
Assert.assertTrue("Node is syncing, must return sync manager", result instanceof Web3.SyncingResult);
Assert.assertTrue("Highest block is 5", ((Web3.SyncingResult) result).highestBlock.compareTo("0x5") == 0);
Assert.assertTrue("Simple blockchain starts from genesis block", ((Web3.SyncingResult) result).currentBlock.compareTo("0x0") == 0);
}
Aggregations