Search in sources :

Example 1 with Factory

use of co.rsk.peg.BtcBlockStoreWithCache.Factory in project rskj by rsksmart.

the class BlockExecutorTest method buildBlockExecutor.

private static BlockExecutor buildBlockExecutor(TrieStore store, RskSystemProperties config) {
    StateRootHandler stateRootHandler = new StateRootHandler(config.getActivationConfig(), new StateRootsStoreImpl(new HashMapDB()));
    Factory btcBlockStoreFactory = new RepositoryBtcBlockStoreWithCache.Factory(config.getNetworkConstants().getBridgeConstants().getBtcParams());
    BridgeSupportFactory bridgeSupportFactory = new BridgeSupportFactory(btcBlockStoreFactory, config.getNetworkConstants().getBridgeConstants(), config.getActivationConfig());
    return new BlockExecutor(config.getActivationConfig(), new RepositoryLocator(store, stateRootHandler), new TransactionExecutorFactory(config, null, null, BLOCK_FACTORY, new ProgramInvokeFactoryImpl(), new PrecompiledContracts(config, bridgeSupportFactory), new BlockTxSignatureCache(new ReceivedTxSignatureCache())));
}
Also used : PrecompiledContracts(org.ethereum.vm.PrecompiledContracts) Factory(co.rsk.peg.BtcBlockStoreWithCache.Factory) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) TransactionExecutorFactory(co.rsk.core.TransactionExecutorFactory) RskTestFactory(org.ethereum.util.RskTestFactory) HashMapDB(org.ethereum.datasource.HashMapDB) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) ProgramInvokeFactoryImpl(org.ethereum.vm.program.invoke.ProgramInvokeFactoryImpl) TransactionExecutorFactory(co.rsk.core.TransactionExecutorFactory)

Example 2 with Factory

use of co.rsk.peg.BtcBlockStoreWithCache.Factory in project rskj by rsksmart.

the class World method getBlockExecutor.

public BlockExecutor getBlockExecutor() {
    final ProgramInvokeFactoryImpl programInvokeFactory = new ProgramInvokeFactoryImpl();
    Factory btcBlockStoreFactory = new RepositoryBtcBlockStoreWithCache.Factory(config.getNetworkConstants().getBridgeConstants().getBtcParams());
    BridgeSupportFactory bridgeSupportFactory = new BridgeSupportFactory(btcBlockStoreFactory, config.getNetworkConstants().getBridgeConstants(), config.getActivationConfig());
    if (this.blockExecutor == null) {
        this.blockExecutor = new BlockExecutor(config.getActivationConfig(), new RepositoryLocator(getTrieStore(), stateRootHandler), new TransactionExecutorFactory(config, blockStore, null, new BlockFactory(config.getActivationConfig()), programInvokeFactory, new PrecompiledContracts(config, bridgeSupportFactory), blockTxSignatureCache));
    }
    return this.blockExecutor;
}
Also used : RepositoryLocator(co.rsk.db.RepositoryLocator) PrecompiledContracts(org.ethereum.vm.PrecompiledContracts) BlockExecutor(co.rsk.core.bc.BlockExecutor) Factory(co.rsk.peg.BtcBlockStoreWithCache.Factory) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) TransactionExecutorFactory(co.rsk.core.TransactionExecutorFactory) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) ProgramInvokeFactoryImpl(org.ethereum.vm.program.invoke.ProgramInvokeFactoryImpl) TransactionExecutorFactory(co.rsk.core.TransactionExecutorFactory)

Aggregations

TransactionExecutorFactory (co.rsk.core.TransactionExecutorFactory)2 BridgeSupportFactory (co.rsk.peg.BridgeSupportFactory)2 Factory (co.rsk.peg.BtcBlockStoreWithCache.Factory)2 PrecompiledContracts (org.ethereum.vm.PrecompiledContracts)2 ProgramInvokeFactoryImpl (org.ethereum.vm.program.invoke.ProgramInvokeFactoryImpl)2 BlockExecutor (co.rsk.core.bc.BlockExecutor)1 RepositoryLocator (co.rsk.db.RepositoryLocator)1 HashMapDB (org.ethereum.datasource.HashMapDB)1 RskTestFactory (org.ethereum.util.RskTestFactory)1