Search in sources :

Example 11 with EthModule

use of co.rsk.rpc.modules.eth.EthModule in project rskj by rsksmart.

the class Web3ImplTest method createWeb3.

private Web3Impl createWeb3(SimpleEthereum eth, PeerServer peerServer) {
    wallet = WalletFactory.createWallet();
    Blockchain blockchain = Web3Mocks.getMockBlockchain();
    BlockStore blockStore = Web3Mocks.getMockBlockStore();
    MiningMainchainView mainchainView = new MiningMainchainViewImpl(blockStore, 449);
    TransactionPool transactionPool = Web3Mocks.getMockTransactionPool();
    PersonalModuleWalletEnabled personalModule = new PersonalModuleWalletEnabled(config, eth, wallet, null);
    EthModule ethModule = new EthModule(config.getNetworkConstants().getBridgeConstants(), config.getNetworkConstants().getChainId(), blockchain, transactionPool, null, new ExecutionBlockRetriever(mainchainView, blockchain, null, null), null, new EthModuleWalletEnabled(wallet), null, new BridgeSupportFactory(null, config.getNetworkConstants().getBridgeConstants(), config.getActivationConfig()), config.getGasEstimationCap());
    TxPoolModule txPoolModule = new TxPoolModuleImpl(Web3Mocks.getMockTransactionPool());
    DebugModule debugModule = new DebugModuleImpl(null, null, Web3Mocks.getMockMessageHandler(), null);
    MinerClient minerClient = new SimpleMinerClient();
    ChannelManager channelManager = new SimpleChannelManager();
    return new Web3RskImpl(eth, blockchain, config, minerClient, Web3Mocks.getMockMinerServer(), personalModule, ethModule, null, txPoolModule, null, debugModule, null, null, channelManager, null, null, null, null, peerServer, null, null, null, null, null, new Web3InformationRetriever(transactionPool, blockchain, mock(RepositoryLocator.class), mock(ExecutionBlockRetriever.class)), null);
}
Also used : BlockStore(org.ethereum.db.BlockStore) ChannelManager(org.ethereum.net.server.ChannelManager) Web3RskImpl(co.rsk.rpc.Web3RskImpl) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) DebugModuleImpl(co.rsk.rpc.modules.debug.DebugModuleImpl) MiningMainchainViewImpl(co.rsk.core.bc.MiningMainchainViewImpl) PersonalModuleWalletEnabled(co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled) MiningMainchainView(co.rsk.core.bc.MiningMainchainView) EthModuleWalletEnabled(co.rsk.rpc.modules.eth.EthModuleWalletEnabled) MinerClient(co.rsk.mine.MinerClient) Web3InformationRetriever(co.rsk.rpc.Web3InformationRetriever) EthModule(co.rsk.rpc.modules.eth.EthModule) DebugModule(co.rsk.rpc.modules.debug.DebugModule) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule)

Example 12 with EthModule

use of co.rsk.rpc.modules.eth.EthModule in project rskj by rsksmart.

the class Web3ImplTest method createWeb3CallNoReturn.

private Web3Impl createWeb3CallNoReturn(Ethereum eth, Blockchain blockchain, RepositoryLocator repositoryLocator, TransactionPool transactionPool, BlockStore blockStore, BlockProcessor nodeBlockProcessor, ConfigCapabilities configCapabilities, ReceiptStore receiptStore) {
    MiningMainchainView miningMainchainViewMock = mock(MiningMainchainView.class);
    ExecutionBlockRetriever executionBlockRetriever = mock(ExecutionBlockRetriever.class);
    wallet = WalletFactory.createWallet();
    PersonalModuleWalletEnabled personalModule = new PersonalModuleWalletEnabled(config, eth, wallet, transactionPool);
    ReversibleTransactionExecutor executor = mock(ReversibleTransactionExecutor.class);
    ProgramResult res = new ProgramResult();
    res.setHReturn(new byte[0]);
    when(executor.executeTransaction(any(), any(), any(), any(), any(), any(), any(), any())).thenReturn(res);
    Web3InformationRetriever retriever = new Web3InformationRetriever(transactionPool, blockchain, repositoryLocator, executionBlockRetriever);
    EthModule ethModule = new EthModule(config.getNetworkConstants().getBridgeConstants(), config.getNetworkConstants().getChainId(), blockchain, transactionPool, executor, new ExecutionBlockRetriever(miningMainchainViewMock, blockchain, null, null), repositoryLocator, new EthModuleWalletEnabled(wallet), new EthModuleTransactionBase(config.getNetworkConstants(), wallet, transactionPool, null), new BridgeSupportFactory(null, config.getNetworkConstants().getBridgeConstants(), config.getActivationConfig()), config.getGasEstimationCap());
    TxPoolModule txPoolModule = new TxPoolModuleImpl(transactionPool);
    DebugModule debugModule = new DebugModuleImpl(null, null, Web3Mocks.getMockMessageHandler(), null);
    RskModule rskModule = new RskModuleImpl(blockchain, blockStore, receiptStore, retriever);
    MinerClient minerClient = new SimpleMinerClient();
    ChannelManager channelManager = new SimpleChannelManager();
    return new Web3RskImpl(eth, blockchain, config, minerClient, Web3Mocks.getMockMinerServer(), personalModule, ethModule, null, txPoolModule, null, debugModule, null, rskModule, channelManager, null, null, blockStore, receiptStore, null, nodeBlockProcessor, null, configCapabilities, new BuildInfo("test", "test"), null, retriever, null);
}
Also used : EthModuleTransactionBase(co.rsk.rpc.modules.eth.EthModuleTransactionBase) ChannelManager(org.ethereum.net.server.ChannelManager) ProgramResult(org.ethereum.vm.program.ProgramResult) RskModule(co.rsk.rpc.modules.rsk.RskModule) Web3RskImpl(co.rsk.rpc.Web3RskImpl) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) DebugModuleImpl(co.rsk.rpc.modules.debug.DebugModuleImpl) PersonalModuleWalletEnabled(co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled) MiningMainchainView(co.rsk.core.bc.MiningMainchainView) EthModuleWalletEnabled(co.rsk.rpc.modules.eth.EthModuleWalletEnabled) MinerClient(co.rsk.mine.MinerClient) Web3InformationRetriever(co.rsk.rpc.Web3InformationRetriever) EthModule(co.rsk.rpc.modules.eth.EthModule) BuildInfo(org.ethereum.util.BuildInfo) DebugModule(co.rsk.rpc.modules.debug.DebugModule) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule) RskModuleImpl(co.rsk.rpc.modules.rsk.RskModuleImpl)

Example 13 with EthModule

use of co.rsk.rpc.modules.eth.EthModule in project rskj by rsksmart.

the class Web3ImplLogsTest method createWeb3.

private Web3Impl createWeb3() {
    Wallet wallet = WalletFactory.createWallet();
    PersonalModule personalModule = new PersonalModuleWalletEnabled(config, eth, wallet, transactionPool);
    EthModule ethModule = new EthModule(config.getNetworkConstants().getBridgeConstants(), config.getNetworkConstants().getChainId(), blockChain, transactionPool, null, new ExecutionBlockRetriever(mainchainView, blockChain, null, null), null, new EthModuleWalletEnabled(wallet), null, new BridgeSupportFactory(null, config.getNetworkConstants().getBridgeConstants(), config.getActivationConfig()), config.getGasEstimationCap());
    TxPoolModule txPoolModule = new TxPoolModuleImpl(transactionPool);
    DebugModule debugModule = new DebugModuleImpl(null, null, Web3Mocks.getMockMessageHandler(), null);
    return new Web3RskImpl(eth, blockChain, config, Web3Mocks.getMockMinerClient(), Web3Mocks.getMockMinerServer(), personalModule, ethModule, null, txPoolModule, null, debugModule, null, null, Web3Mocks.getMockChannelManager(), null, null, blockStore, receiptStore, null, null, null, new SimpleConfigCapabilities(), null, new BlocksBloomStore(2, 0, new HashMapDB()), mock(Web3InformationRetriever.class), null);
}
Also used : Wallet(co.rsk.core.Wallet) Web3RskImpl(co.rsk.rpc.Web3RskImpl) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) DebugModuleImpl(co.rsk.rpc.modules.debug.DebugModuleImpl) PersonalModuleWalletEnabled(co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled) HashMapDB(org.ethereum.datasource.HashMapDB) EthModuleWalletEnabled(co.rsk.rpc.modules.eth.EthModuleWalletEnabled) BlocksBloomStore(co.rsk.logfilter.BlocksBloomStore) Web3InformationRetriever(co.rsk.rpc.Web3InformationRetriever) PersonalModule(co.rsk.rpc.modules.personal.PersonalModule) EthModule(co.rsk.rpc.modules.eth.EthModule) DebugModule(co.rsk.rpc.modules.debug.DebugModule) SimpleConfigCapabilities(org.ethereum.rpc.Simples.SimpleConfigCapabilities) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule)

Aggregations

EthModule (co.rsk.rpc.modules.eth.EthModule)13 ExecutionBlockRetriever (co.rsk.rpc.ExecutionBlockRetriever)11 TxPoolModule (co.rsk.rpc.modules.txpool.TxPoolModule)11 TxPoolModuleImpl (co.rsk.rpc.modules.txpool.TxPoolModuleImpl)10 Web3RskImpl (co.rsk.rpc.Web3RskImpl)9 EthModuleWalletEnabled (co.rsk.rpc.modules.eth.EthModuleWalletEnabled)9 PersonalModuleWalletEnabled (co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled)8 DebugModule (co.rsk.rpc.modules.debug.DebugModule)6 PersonalModule (co.rsk.rpc.modules.personal.PersonalModule)6 MinerClient (co.rsk.mine.MinerClient)5 BridgeSupportFactory (co.rsk.peg.BridgeSupportFactory)5 DebugModuleImpl (co.rsk.rpc.modules.debug.DebugModuleImpl)5 ChannelManager (org.ethereum.net.server.ChannelManager)5 RskSystemProperties (co.rsk.config.RskSystemProperties)4 MiningMainchainView (co.rsk.core.bc.MiningMainchainView)4 Web3InformationRetriever (co.rsk.rpc.Web3InformationRetriever)4 EthModuleSolidityDisabled (co.rsk.rpc.modules.eth.EthModuleSolidityDisabled)4 TestSystemProperties (co.rsk.config.TestSystemProperties)3 Wallet (co.rsk.core.Wallet)3 RskModule (co.rsk.rpc.modules.rsk.RskModule)3