use of co.rsk.pcc.ExecutionEnvironment in project rskj by rsksmart.
the class EnvironmentUtils method getEnvironmentWithBlockchainOfLength.
public static ExecutionEnvironment getEnvironmentWithBlockchainOfLength(int blockchainLength) {
World world = new World();
TestSystemProperties config = new TestSystemProperties();
buildBlockchainOfLength(world, config, blockchainLength);
ExecutionEnvironment executionEnvironment = mock(ExecutionEnvironment.class);
when(executionEnvironment.getBlockStore()).thenReturn(world.getBlockStore());
when(executionEnvironment.getBlock()).thenReturn(world.getBlockChain().getBestBlock());
return executionEnvironment;
}
use of co.rsk.pcc.ExecutionEnvironment in project rskj by rsksmart.
the class GetMultisigScriptHashTest method createMethod.
@Before
public void createMethod() {
ExecutionEnvironment executionEnvironment = mock(ExecutionEnvironment.class);
method = new GetMultisigScriptHash(executionEnvironment);
}
use of co.rsk.pcc.ExecutionEnvironment in project rskj by rsksmart.
the class ToBase58CheckTest method createMethod.
@Before
public void createMethod() {
ExecutionEnvironment executionEnvironment = mock(ExecutionEnvironment.class);
method = new ToBase58Check(executionEnvironment);
}
use of co.rsk.pcc.ExecutionEnvironment in project rskj by rsksmart.
the class BlockAccessorTest method getTenBlocksFromTheTip.
@Test
public void getTenBlocksFromTheTip() throws NativeContractIllegalArgumentException {
ExecutionEnvironment executionEnvironment = EnvironmentUtils.getEnvironmentWithBlockchainOfLength(100);
for (short i = 0; i < 10; i++) {
Optional<Block> block = blockAccessor.getBlock(i, executionEnvironment);
Assert.assertTrue(block.isPresent());
Assert.assertEquals(99 - i, block.get().getNumber());
}
}
use of co.rsk.pcc.ExecutionEnvironment in project rskj by rsksmart.
the class HDWalletUtilsTest method createContract.
@Before
public void createContract() {
RskSystemProperties config = new TestSystemProperties();
ExecutionEnvironment executionEnvironment = mock(ExecutionEnvironment.class);
contract = spy(new HDWalletUtils(config.getActivationConfig(), new RskAddress("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")));
when(contract.getExecutionEnvironment()).thenReturn(executionEnvironment);
}
Aggregations