Search in sources :

Example 1 with TxPoolModuleImpl

use of co.rsk.rpc.modules.txpool.TxPoolModuleImpl in project rskj by rsksmart.

the class Web3ImplScoringTest method createWeb3.

private static Web3Impl createWeb3(PeerScoringManager peerScoringManager) {
    SimpleRsk rsk = new SimpleRsk();
    World world = new World();
    rsk.blockchain = world.getBlockChain();
    Wallet wallet = WalletFactory.createWallet();
    RskSystemProperties config = new RskSystemProperties();
    PersonalModule pm = new PersonalModuleWalletEnabled(config, rsk, wallet, null);
    EthModule em = new EthModule(config, world.getBlockChain(), null, new ExecutionBlockRetriever(world.getBlockChain(), null, null), new EthModuleSolidityDisabled(), new EthModuleWalletEnabled(config, rsk, wallet, null));
    TxPoolModule tpm = new TxPoolModuleImpl(Web3Mocks.getMockTransactionPool());
    return new Web3RskImpl(rsk, world.getBlockChain(), null, config, Web3Mocks.getMockMinerClient(), Web3Mocks.getMockMinerServer(), pm, em, tpm, Web3Mocks.getMockChannelManager(), rsk.getRepository(), peerScoringManager, null, null, null, null, null, null, null);
}
Also used : EthModuleSolidityDisabled(co.rsk.rpc.modules.eth.EthModuleSolidityDisabled) Wallet(co.rsk.core.Wallet) Web3RskImpl(co.rsk.rpc.Web3RskImpl) SimpleRsk(org.ethereum.rpc.Simples.SimpleRsk) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) World(co.rsk.test.World) PersonalModuleWalletEnabled(co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled) EthModuleWalletEnabled(co.rsk.rpc.modules.eth.EthModuleWalletEnabled) PersonalModule(co.rsk.rpc.modules.personal.PersonalModule) EthModule(co.rsk.rpc.modules.eth.EthModule) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule) RskSystemProperties(co.rsk.config.RskSystemProperties)

Example 2 with TxPoolModuleImpl

use of co.rsk.rpc.modules.txpool.TxPoolModuleImpl in project rskj by rsksmart.

the class Web3ImplTest method createWeb3.

private Web3Impl createWeb3(Ethereum eth, Blockchain blockchain, TransactionPool transactionPool, BlockStore blockStore, BlockProcessor nodeBlockProcessor, ConfigCapabilities configCapabilities, ReceiptStore receiptStore) {
    wallet = WalletFactory.createWallet();
    PersonalModuleWalletEnabled personalModule = new PersonalModuleWalletEnabled(config, eth, wallet, transactionPool);
    ReversibleTransactionExecutor executor = Mockito.mock(ReversibleTransactionExecutor.class);
    ProgramResult res = new ProgramResult();
    res.setHReturn(TypeConverter.stringHexToByteArray("0x0000000000000000000000000000000000000000000000000000000064617665"));
    Mockito.when(executor.executeTransaction(Matchers.any(), Matchers.any(), Matchers.any(), Matchers.any(), Matchers.any(), Matchers.any(), Matchers.any(), Matchers.any())).thenReturn(res);
    EthModule ethModule = new EthModule(config, blockchain, executor, new ExecutionBlockRetriever(blockchain, null, null), new EthModuleSolidityDisabled(), new EthModuleWalletEnabled(config, eth, wallet, transactionPool));
    TxPoolModule txPoolModule = new TxPoolModuleImpl(transactionPool);
    MinerClient minerClient = new SimpleMinerClient();
    ChannelManager channelManager = new SimpleChannelManager();
    return new Web3RskImpl(eth, blockchain, transactionPool, config, minerClient, Web3Mocks.getMockMinerServer(), personalModule, ethModule, txPoolModule, channelManager, Web3Mocks.getMockRepository(), null, null, blockStore, receiptStore, null, nodeBlockProcessor, null, configCapabilities);
}
Also used : ChannelManager(org.ethereum.net.server.ChannelManager) EthModuleSolidityDisabled(co.rsk.rpc.modules.eth.EthModuleSolidityDisabled) ProgramResult(org.ethereum.vm.program.ProgramResult) Web3RskImpl(co.rsk.rpc.Web3RskImpl) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) PersonalModuleWalletEnabled(co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled) EthModuleWalletEnabled(co.rsk.rpc.modules.eth.EthModuleWalletEnabled) MinerClient(co.rsk.mine.MinerClient) EthModule(co.rsk.rpc.modules.eth.EthModule) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule)

Example 3 with TxPoolModuleImpl

use of co.rsk.rpc.modules.txpool.TxPoolModuleImpl in project rskj by rsksmart.

the class Web3ImplLogsTest method createWeb3.

private Web3Impl createWeb3(Ethereum eth, Blockchain blockchain, TransactionPool transactionPool, ReceiptStore receiptStore, Wallet wallet) {
    PersonalModule personalModule = new PersonalModuleWalletEnabled(config, eth, wallet, null);
    EthModule ethModule = new EthModule(config, blockchain, null, new ExecutionBlockRetriever(blockchain, null, null), new EthModuleSolidityDisabled(), new EthModuleWalletEnabled(config, eth, wallet, null));
    TxPoolModule txPoolModule = new TxPoolModuleImpl(Web3Mocks.getMockTransactionPool());
    return new Web3RskImpl(eth, blockchain, transactionPool, config, Web3Mocks.getMockMinerClient(), Web3Mocks.getMockMinerServer(), personalModule, ethModule, txPoolModule, Web3Mocks.getMockChannelManager(), Web3Mocks.getMockRepository(), null, null, blockchain.getBlockStore(), receiptStore, null, null, null, new SimpleConfigCapabilities());
}
Also used : EthModuleSolidityDisabled(co.rsk.rpc.modules.eth.EthModuleSolidityDisabled) PersonalModule(co.rsk.rpc.modules.personal.PersonalModule) EthModule(co.rsk.rpc.modules.eth.EthModule) Web3RskImpl(co.rsk.rpc.Web3RskImpl) SimpleConfigCapabilities(org.ethereum.rpc.Simples.SimpleConfigCapabilities) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) PersonalModuleWalletEnabled(co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) EthModuleWalletEnabled(co.rsk.rpc.modules.eth.EthModuleWalletEnabled) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule)

Example 4 with TxPoolModuleImpl

use of co.rsk.rpc.modules.txpool.TxPoolModuleImpl in project rskj by rsksmart.

the class Web3RskImplTest method web3_ext_dumpState.

@Test
public void web3_ext_dumpState() throws Exception {
    Rsk rsk = Mockito.mock(Rsk.class);
    Blockchain blockchain = Mockito.mock(Blockchain.class);
    NetworkStateExporter networkStateExporter = Mockito.mock(NetworkStateExporter.class);
    Mockito.when(networkStateExporter.exportStatus(Mockito.anyString())).thenReturn(true);
    Block block = Mockito.mock(Block.class);
    Mockito.when(block.getHash()).thenReturn(PegTestUtils.createHash3());
    Mockito.when(block.getNumber()).thenReturn(1L);
    BlockStore blockStore = Mockito.mock(BlockStore.class);
    Mockito.when(blockStore.getBestBlock()).thenReturn(block);
    Mockito.when(networkStateExporter.exportStatus(Mockito.anyString())).thenReturn(true);
    Mockito.when(blockchain.getBestBlock()).thenReturn(block);
    Wallet wallet = WalletFactory.createWallet();
    RskSystemProperties config = new RskSystemProperties();
    PersonalModule pm = new PersonalModuleWalletEnabled(config, rsk, wallet, null);
    EthModule em = new EthModule(config, blockchain, null, new ExecutionBlockRetriever(blockchain, null, null), new EthModuleSolidityDisabled(), new EthModuleWalletEnabled(config, rsk, wallet, null));
    TxPoolModule tpm = new TxPoolModuleImpl(Web3Mocks.getMockTransactionPool());
    Web3RskImpl web3 = new Web3RskImpl(rsk, blockchain, Web3Mocks.getMockTransactionPool(), config, Web3Mocks.getMockMinerClient(), Web3Mocks.getMockMinerServer(), pm, em, tpm, Web3Mocks.getMockChannelManager(), Web3Mocks.getMockRepository(), null, networkStateExporter, blockStore, null, null, null, null, null);
    web3.ext_dumpState();
}
Also used : BlockStore(org.ethereum.db.BlockStore) EthModuleSolidityDisabled(co.rsk.rpc.modules.eth.EthModuleSolidityDisabled) Wallet(co.rsk.core.Wallet) Blockchain(org.ethereum.core.Blockchain) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) Rsk(co.rsk.core.Rsk) PersonalModuleWalletEnabled(co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled) EthModuleWalletEnabled(co.rsk.rpc.modules.eth.EthModuleWalletEnabled) NetworkStateExporter(co.rsk.core.NetworkStateExporter) PersonalModule(co.rsk.rpc.modules.personal.PersonalModule) EthModule(co.rsk.rpc.modules.eth.EthModule) Block(org.ethereum.core.Block) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule) RskSystemProperties(co.rsk.config.RskSystemProperties) Test(org.junit.Test)

Example 5 with TxPoolModuleImpl

use of co.rsk.rpc.modules.txpool.TxPoolModuleImpl in project rskj by rsksmart.

the class Web3ImplSnapshotTest method createWeb3.

private static Web3Impl createWeb3(World world, SimpleEthereum ethereum, MinerServer minerServer) {
    MinerClientImpl minerClient = new MinerClientImpl(null, minerServer, config);
    PersonalModule pm = new PersonalModuleWalletDisabled();
    TxPoolModule tpm = new TxPoolModuleImpl(Web3Mocks.getMockTransactionPool());
    ethereum.repository = world.getRepository();
    ethereum.blockchain = world.getBlockChain();
    return new Web3Impl(ethereum, world.getBlockChain(), null, world.getBlockChain().getBlockStore(), null, Web3Mocks.getMockProperties(), minerClient, minerServer, pm, null, tpm, Web3Mocks.getMockChannelManager(), ethereum.repository, null, null, null, null, null);
}
Also used : PersonalModule(co.rsk.rpc.modules.personal.PersonalModule) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) PersonalModuleWalletDisabled(co.rsk.rpc.modules.personal.PersonalModuleWalletDisabled) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule)

Aggregations

TxPoolModule (co.rsk.rpc.modules.txpool.TxPoolModule)9 TxPoolModuleImpl (co.rsk.rpc.modules.txpool.TxPoolModuleImpl)9 EthModule (co.rsk.rpc.modules.eth.EthModule)7 ExecutionBlockRetriever (co.rsk.rpc.ExecutionBlockRetriever)6 Web3RskImpl (co.rsk.rpc.Web3RskImpl)6 EthModuleSolidityDisabled (co.rsk.rpc.modules.eth.EthModuleSolidityDisabled)6 EthModuleWalletEnabled (co.rsk.rpc.modules.eth.EthModuleWalletEnabled)6 PersonalModule (co.rsk.rpc.modules.personal.PersonalModule)6 RskSystemProperties (co.rsk.config.RskSystemProperties)5 PersonalModuleWalletEnabled (co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled)5 PersonalModuleWalletDisabled (co.rsk.rpc.modules.personal.PersonalModuleWalletDisabled)4 Test (org.junit.Test)4 MinerClient (co.rsk.mine.MinerClient)3 Ethereum (org.ethereum.facade.Ethereum)3 Wallet (co.rsk.core.Wallet)2 BlockStore (org.ethereum.db.BlockStore)2 ChannelManager (org.ethereum.net.server.ChannelManager)2 CompilationResultDTO (org.ethereum.rpc.dto.CompilationResultDTO)2 NetworkStateExporter (co.rsk.core.NetworkStateExporter)1 Rsk (co.rsk.core.Rsk)1