use of co.rsk.config.RskSystemProperties 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);
}
use of co.rsk.config.RskSystemProperties in project rskj by rsksmart.
the class ContractRunner method executeTransaction.
private TransactionExecutor executeTransaction(Transaction transaction) {
Repository track = repository.startTracking();
TransactionExecutor executor = new TransactionExecutor(new RskSystemProperties(), transaction, 0, RskAddress.nullAddress(), repository, blockStore, receiptStore, new ProgramInvokeFactoryImpl(), blockchain.getBestBlock());
executor.init();
executor.execute();
executor.go();
executor.finalization();
track.commit();
return executor;
}
use of co.rsk.config.RskSystemProperties in project rskj by rsksmart.
the class BlockBuilder method build.
public Block build() {
Block block = blockGenerator.createChildBlock(parent, txs, uncles, difficulty, this.minGasPrice, gasLimit);
if (blockChain != null) {
BlockExecutor executor = new BlockExecutor(new RskSystemProperties(), blockChain.getRepository(), null, blockChain.getBlockStore(), blockChain.getListener());
executor.executeAndFill(block, parent);
}
return block;
}
use of co.rsk.config.RskSystemProperties in project rskj by rsksmart.
the class ProgramMemoryTest method createProgram.
@Before
public void createProgram() {
RskSystemProperties config = new RskSystemProperties();
program = new Program(config.getVmConfig(), new PrecompiledContracts(config), mock(BlockchainConfig.class), ByteUtil.EMPTY_BYTE_ARRAY, pi, null);
}
use of co.rsk.config.RskSystemProperties in project rskj by rsksmart.
the class BridgeStateTest method recreateFromEmptyStorageProvider.
@Test
public void recreateFromEmptyStorageProvider() throws IOException {
RskSystemProperties config = new RskSystemProperties();
Repository repository = new RepositoryImpl(config, new TrieStoreImpl(new HashMapDB()));
BridgeConstants bridgeConstants = config.getBlockchainConfig().getCommonConstants().getBridgeConstants();
BridgeStorageProvider provider = new BridgeStorageProvider(repository, PrecompiledContracts.BRIDGE_ADDR, bridgeConstants);
BridgeState state = new BridgeState(42, provider);
BridgeState clone = BridgeState.create(bridgeConstants, state.getEncoded());
Assert.assertNotNull(clone);
Assert.assertEquals(42, clone.getBtcBlockchainBestChainHeight());
Assert.assertTrue(clone.getBtcTxHashesAlreadyProcessed().isEmpty());
Assert.assertTrue(clone.getActiveFederationBtcUTXOs().isEmpty());
Assert.assertTrue(clone.getRskTxsWaitingForSignatures().isEmpty());
}
Aggregations