use of org.ethereum.core.Blockchain in project rskj by rsksmart.
the class Web3ImplSnapshotTest method resetSnapshots.
@Test
public void resetSnapshots() {
World world = new World();
Web3Impl web3 = createWeb3(world);
Blockchain blockchain = world.getBlockChain();
BlockChainStatus status = blockchain.getStatus();
addBlocks(blockchain, 10);
Assert.assertEquals(10, blockchain.getBestBlock().getNumber());
web3.evm_reset();
Assert.assertEquals(0, blockchain.getBestBlock().getNumber());
BlockChainStatus newStatus = blockchain.getStatus();
Assert.assertEquals(status.getBestBlock().getHash(), newStatus.getBestBlock().getHash());
Assert.assertEquals(status.getTotalDifficulty(), newStatus.getTotalDifficulty());
}
Aggregations