use of org.ethereum.facade.Ethereum in project rskj by rsksmart.
the class Web3ImplTest method eth_mining.
@Test
public void eth_mining() {
Ethereum ethMock = Web3Mocks.getMockEthereum();
Blockchain blockchain = Web3Mocks.getMockBlockchain();
TransactionPool transactionPool = Web3Mocks.getMockTransactionPool();
BlockStore blockStore = Web3Mocks.getMockBlockStore();
RskSystemProperties mockProperties = Web3Mocks.getMockProperties();
MinerClient minerClient = new SimpleMinerClient();
PersonalModule personalModule = new PersonalModuleWalletDisabled();
TxPoolModule txPoolModule = new TxPoolModuleImpl(Web3Mocks.getMockTransactionPool());
Web3 web3 = new Web3Impl(ethMock, blockchain, transactionPool, blockStore, null, mockProperties, minerClient, null, personalModule, null, txPoolModule, Web3Mocks.getMockChannelManager(), Web3Mocks.getMockRepository(), null, null, null, null, null);
Assert.assertTrue("Node is not mining", !web3.eth_mining());
try {
minerClient.mine();
Assert.assertTrue("Node is mining", web3.eth_mining());
} finally {
minerClient.stop();
}
Assert.assertTrue("Node is not mining", !web3.eth_mining());
}
Aggregations