Search in sources :

Example 1 with MinerServer

use of co.rsk.mine.MinerServer in project rskj by rsksmart.

the class Web3ImplTest method eth_coinbase.

@Test
public void eth_coinbase() {
    String originalCoinbase = "1dcc4de8dec75d7aab85b513f0a142fd40d49347";
    MinerServer minerServerMock = mock(MinerServer.class);
    when(minerServerMock.getCoinbaseAddress()).thenReturn(new RskAddress(originalCoinbase));
    Ethereum ethMock = Web3Mocks.getMockEthereum();
    Blockchain blockchain = Web3Mocks.getMockBlockchain();
    TransactionPool transactionPool = Web3Mocks.getMockTransactionPool();
    BlockStore blockStore = Web3Mocks.getMockBlockStore();
    RskSystemProperties mockProperties = Web3Mocks.getMockProperties();
    PersonalModule personalModule = new PersonalModuleWalletDisabled();
    Web3 web3 = new Web3Impl(ethMock, blockchain, blockStore, null, mockProperties, null, minerServerMock, personalModule, null, null, null, null, null, null, null, Web3Mocks.getMockChannelManager(), null, null, null, null, null, null, null, mock(Web3InformationRetriever.class), null);
    assertEquals("0x" + originalCoinbase, web3.eth_coinbase());
    verify(minerServerMock, times(1)).getCoinbaseAddress();
}
Also used : BlockStore(org.ethereum.db.BlockStore) PersonalModuleWalletDisabled(co.rsk.rpc.modules.personal.PersonalModuleWalletDisabled) Web3InformationRetriever(co.rsk.rpc.Web3InformationRetriever) MinerServer(co.rsk.mine.MinerServer) Ethereum(org.ethereum.facade.Ethereum) PersonalModule(co.rsk.rpc.modules.personal.PersonalModule) RskSystemProperties(co.rsk.config.RskSystemProperties) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

RskSystemProperties (co.rsk.config.RskSystemProperties)1 MinerServer (co.rsk.mine.MinerServer)1 Web3InformationRetriever (co.rsk.rpc.Web3InformationRetriever)1 PersonalModule (co.rsk.rpc.modules.personal.PersonalModule)1 PersonalModuleWalletDisabled (co.rsk.rpc.modules.personal.PersonalModuleWalletDisabled)1 BlockStore (org.ethereum.db.BlockStore)1 Ethereum (org.ethereum.facade.Ethereum)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1