Search in sources :

Example 1 with MiningMainchainViewImpl

use of co.rsk.core.bc.MiningMainchainViewImpl in project rskj by rsksmart.

the class Web3ImplScoringTest method createWeb3.

private static Web3Impl createWeb3(PeerScoringManager peerScoringManager) {
    SimpleEthereum rsk = new SimpleEthereum();
    World world = new World();
    rsk.blockchain = world.getBlockChain();
    MiningMainchainView miningMainchainView = new MiningMainchainViewImpl(world.getBlockStore(), 2);
    Wallet wallet = WalletFactory.createWallet();
    TestSystemProperties config = new TestSystemProperties();
    PersonalModule pm = new PersonalModuleWalletEnabled(config, rsk, wallet, null);
    EthModule em = new EthModule(config.getNetworkConstants().getBridgeConstants(), config.getNetworkConstants().getChainId(), world.getBlockChain(), null, null, new ExecutionBlockRetriever(miningMainchainView, world.getBlockChain(), null, null), null, new EthModuleWalletEnabled(wallet), null, new BridgeSupportFactory(null, config.getNetworkConstants().getBridgeConstants(), config.getActivationConfig()), config.getGasEstimationCap());
    TxPoolModule tpm = new TxPoolModuleImpl(Web3Mocks.getMockTransactionPool());
    DebugModule dm = new DebugModuleImpl(null, null, Web3Mocks.getMockMessageHandler(), null);
    return new Web3RskImpl(rsk, world.getBlockChain(), config, Web3Mocks.getMockMinerClient(), Web3Mocks.getMockMinerServer(), pm, em, null, tpm, null, dm, null, null, Web3Mocks.getMockChannelManager(), peerScoringManager, null, null, null, null, null, null, null, null, null, null, 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) World(co.rsk.test.World) 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) PersonalModule(co.rsk.rpc.modules.personal.PersonalModule) EthModule(co.rsk.rpc.modules.eth.EthModule) DebugModule(co.rsk.rpc.modules.debug.DebugModule) SimpleEthereum(org.ethereum.rpc.Simples.SimpleEthereum) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule) TestSystemProperties(co.rsk.config.TestSystemProperties)

Example 2 with MiningMainchainViewImpl

use of co.rsk.core.bc.MiningMainchainViewImpl 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)

Aggregations

MiningMainchainView (co.rsk.core.bc.MiningMainchainView)2 MiningMainchainViewImpl (co.rsk.core.bc.MiningMainchainViewImpl)2 BridgeSupportFactory (co.rsk.peg.BridgeSupportFactory)2 ExecutionBlockRetriever (co.rsk.rpc.ExecutionBlockRetriever)2 Web3RskImpl (co.rsk.rpc.Web3RskImpl)2 DebugModule (co.rsk.rpc.modules.debug.DebugModule)2 DebugModuleImpl (co.rsk.rpc.modules.debug.DebugModuleImpl)2 EthModule (co.rsk.rpc.modules.eth.EthModule)2 EthModuleWalletEnabled (co.rsk.rpc.modules.eth.EthModuleWalletEnabled)2 PersonalModuleWalletEnabled (co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled)2 TxPoolModule (co.rsk.rpc.modules.txpool.TxPoolModule)2 TxPoolModuleImpl (co.rsk.rpc.modules.txpool.TxPoolModuleImpl)2 TestSystemProperties (co.rsk.config.TestSystemProperties)1 Wallet (co.rsk.core.Wallet)1 MinerClient (co.rsk.mine.MinerClient)1 Web3InformationRetriever (co.rsk.rpc.Web3InformationRetriever)1 PersonalModule (co.rsk.rpc.modules.personal.PersonalModule)1 World (co.rsk.test.World)1 BlockStore (org.ethereum.db.BlockStore)1 ChannelManager (org.ethereum.net.server.ChannelManager)1