Search in sources :

Example 76 with TestSystemProperties

use of co.rsk.config.TestSystemProperties in project rskj by rsksmart.

the class EthModuleTestUtils method buildBasicEthModuleForGasEstimation.

public static EthModuleGasEstimation buildBasicEthModuleForGasEstimation(World world) {
    TestSystemProperties config = new TestSystemProperties();
    TransactionExecutorFactory executor = buildBasicExecutorFactory(world, config);
    return new EthModuleGasEstimation(null, Constants.REGTEST_CHAIN_ID, world.getBlockChain(), null, new ReversibleTransactionExecutor(world.getRepositoryLocator(), executor), new ExecutionBlockRetriever(null, world.getBlockChain(), null, null), null, null, null, world.getBridgeSupportFactory(), config.getGasEstimationCap());
}
Also used : ReversibleTransactionExecutor(co.rsk.core.ReversibleTransactionExecutor) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) TestSystemProperties(co.rsk.config.TestSystemProperties) TransactionExecutorFactory(co.rsk.core.TransactionExecutorFactory)

Example 77 with TestSystemProperties

use of co.rsk.config.TestSystemProperties in project rskj by rsksmart.

the class EthModuleTestUtils method buildBasicEthModule.

public static EthModule buildBasicEthModule(World world) {
    TestSystemProperties config = new TestSystemProperties();
    TransactionExecutorFactory executor = buildBasicExecutorFactory(world, config);
    return new EthModule(null, Constants.REGTEST_CHAIN_ID, world.getBlockChain(), null, new ReversibleTransactionExecutor(world.getRepositoryLocator(), executor), new ExecutionBlockRetriever(null, world.getBlockChain(), null, null), null, null, null, world.getBridgeSupportFactory(), config.getGasEstimationCap());
}
Also used : EthModule(co.rsk.rpc.modules.eth.EthModule) ReversibleTransactionExecutor(co.rsk.core.ReversibleTransactionExecutor) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) TestSystemProperties(co.rsk.config.TestSystemProperties) TransactionExecutorFactory(co.rsk.core.TransactionExecutorFactory)

Example 78 with TestSystemProperties

use of co.rsk.config.TestSystemProperties in project rskj by rsksmart.

the class ProgramMemoryTest method createProgram.

@Before
public void createProgram() {
    TestSystemProperties config = new TestSystemProperties();
    program = new Program(config.getVmConfig(), new PrecompiledContracts(config, null), new BlockFactory(config.getActivationConfig()), mock(ActivationConfig.ForBlock.class), ByteUtil.EMPTY_BYTE_ARRAY, pi, null, new HashSet<>());
}
Also used : Program(org.ethereum.vm.program.Program) BlockFactory(org.ethereum.core.BlockFactory) TestSystemProperties(co.rsk.config.TestSystemProperties) ActivationConfig(org.ethereum.config.blockchain.upgrades.ActivationConfig) HashSet(java.util.HashSet) Before(org.junit.Before)

Example 79 with TestSystemProperties

use of co.rsk.config.TestSystemProperties in project rskj by rsksmart.

the class NestedContractsTest method buildEthModule.

private EthModule buildEthModule(World world) {
    final TestSystemProperties config = new TestSystemProperties();
    TransactionExecutorFactory executor = new TransactionExecutorFactory(config, world.getBlockStore(), null, null, new ProgramInvokeFactoryImpl(), new PrecompiledContracts(config, world.getBridgeSupportFactory()), null);
    return new EthModule(null, Constants.REGTEST_CHAIN_ID, world.getBlockChain(), world.getTransactionPool(), new ReversibleTransactionExecutor(world.getRepositoryLocator(), executor), new ExecutionBlockRetriever(null, world.getBlockChain(), null, null), world.getRepositoryLocator(), null, null, world.getBridgeSupportFactory(), config.getGasEstimationCap());
}
Also used : PrecompiledContracts(org.ethereum.vm.PrecompiledContracts) EthModule(co.rsk.rpc.modules.eth.EthModule) ReversibleTransactionExecutor(co.rsk.core.ReversibleTransactionExecutor) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) TestSystemProperties(co.rsk.config.TestSystemProperties) ProgramInvokeFactoryImpl(org.ethereum.vm.program.invoke.ProgramInvokeFactoryImpl) TransactionExecutorFactory(co.rsk.core.TransactionExecutorFactory)

Example 80 with TestSystemProperties

use of co.rsk.config.TestSystemProperties in project rskj by rsksmart.

the class WalletFactory method createPersistentWallet.

public static Wallet createPersistentWallet(String storeName) {
    final TestSystemProperties config = new TestSystemProperties();
    KeyValueDataSource ds = new LevelDbDataSource(storeName, config.databaseDir());
    ds.init();
    return new Wallet(ds);
}
Also used : KeyValueDataSource(org.ethereum.datasource.KeyValueDataSource) LevelDbDataSource(org.ethereum.datasource.LevelDbDataSource) TestSystemProperties(co.rsk.config.TestSystemProperties)

Aggregations

TestSystemProperties (co.rsk.config.TestSystemProperties)158 Test (org.junit.Test)130 BlockChainBuilder (co.rsk.test.builders.BlockChainBuilder)109 Blockchain (org.ethereum.core.Blockchain)78 SyncConfiguration (co.rsk.net.sync.SyncConfiguration)75 SimplePeer (co.rsk.net.simples.SimplePeer)69 Block (org.ethereum.core.Block)69 BlockGenerator (co.rsk.blockchain.utils.BlockGenerator)56 ConsensusValidationMainchainView (co.rsk.core.bc.ConsensusValidationMainchainView)23 EthereumListener (org.ethereum.listener.EthereumListener)23 BlockStore (org.ethereum.db.BlockStore)21 RskSystemProperties (co.rsk.config.RskSystemProperties)17 ActivationConfigsForTest (org.ethereum.config.blockchain.upgrades.ActivationConfigsForTest)16 Keccak256 (co.rsk.crypto.Keccak256)13 RepositoryLocator (co.rsk.db.RepositoryLocator)10 World (co.rsk.test.World)10 PrecompiledContracts (org.ethereum.vm.PrecompiledContracts)9 Ignore (org.junit.Ignore)9 TransactionExecutorFactory (co.rsk.core.TransactionExecutorFactory)8 AsyncNodeBlockProcessorListener (co.rsk.net.utils.AsyncNodeBlockProcessorListener)8