use of co.rsk.db.StateRootsStoreImpl in project rskj by rsksmart.
the class WorldDslProcessor method processBlockChainCommand.
private void processBlockChainCommand(DslCommand cmd) {
Block parent = world.getBlockByName(cmd.getArgument(0));
int k = 1;
while (cmd.getArgument(k) != null) {
String name = cmd.getArgument(k);
int difficulty = k;
if (name != null) {
StringTokenizer difficultyTokenizer = new StringTokenizer(name, ":");
name = difficultyTokenizer.nextToken();
difficulty = difficultyTokenizer.hasMoreTokens() ? parseDifficulty(difficultyTokenizer.nextToken(), k) : k;
}
Block block = blockBuilder.difficulty(difficulty).parent(parent).build();
final ProgramInvokeFactoryImpl programInvokeFactory = new ProgramInvokeFactoryImpl();
final TestSystemProperties config = new TestSystemProperties();
StateRootHandler stateRootHandler = new StateRootHandler(config.getActivationConfig(), new StateRootsStoreImpl(new HashMapDB()));
BlockExecutor executor = new BlockExecutor(config.getActivationConfig(), new RepositoryLocator(world.getTrieStore(), stateRootHandler), new TransactionExecutorFactory(config, world.getBlockStore(), null, new BlockFactory(config.getActivationConfig()), programInvokeFactory, null, world.getBlockTxSignatureCache()));
executor.executeAndFill(block, parent.getHeader());
world.saveBlock(name, block);
parent = block;
k++;
}
}
Aggregations