use of co.rsk.core.bc.PendingState in project rskj by rsksmart.
the class EthModuleTest method getCode.
@Test
public void getCode() {
byte[] expectedCode = new byte[] { 1, 2, 3 };
TransactionPool mockTransactionPool = mock(TransactionPool.class);
PendingState mockPendingState = mock(PendingState.class);
doReturn(expectedCode).when(mockPendingState).getCode(any(RskAddress.class));
doReturn(mockPendingState).when(mockTransactionPool).getPendingState();
EthModule eth = new EthModule(null, (byte) 0, null, mockTransactionPool, null, null, null, null, null, new BridgeSupportFactory(null, null, null), config.getGasEstimationCap());
String addr = eth.getCode(TestUtils.randomAddress().toHexString(), "pending");
Assert.assertThat(Hex.decode(addr.substring("0x".length())), is(expectedCode));
}
use of co.rsk.core.bc.PendingState in project rskj by rsksmart.
the class Web3InformationRetrieverTest method getState_pending.
@Test
public void getState_pending() {
PendingState aip = mock(PendingState.class);
when(txPool.getPendingState()).thenReturn(aip);
AccountInformationProvider result = target.getInformationProvider("pending");
assertEquals(aip, result);
}
Aggregations