use of org.ethereum.vm.program.ProgramResult in project rskj by rsksmart.
the class ProgramTest method returnDataSizeTests.
@Test
public void returnDataSizeTests() {
ProgramResult result = TestContract.returnDataTest().executeFunction("testSize", BigInteger.ZERO);
Assert.assertFalse(result.isRevert());
Assert.assertNull(result.getException());
}
use of org.ethereum.vm.program.ProgramResult in project rskj by rsksmart.
the class ProgramTest method childContractDoesntInheritMsgValue.
@Test
public void childContractDoesntInheritMsgValue() {
ProgramResult result = TestContract.parent().executeFunction("createChild", BigInteger.TEN);
Assert.assertFalse(result.isRevert());
Assert.assertNull(result.getException());
}
use of org.ethereum.vm.program.ProgramResult in project rskj by rsksmart.
the class ProgramTest method childContractGetsStipend.
@Test
public void childContractGetsStipend() {
ProgramResult result = TestContract.bankTest().executeFunction("test", BigInteger.TEN);
Assert.assertFalse(result.isRevert());
Assert.assertNull(result.getException());
Assert.assertArrayEquals(new Object[] { BigInteger.valueOf(43) }, TestContract.bankTest().functions.get("test").decodeResult(result.getHReturn()));
}
use of org.ethereum.vm.program.ProgramResult in project rskj by rsksmart.
the class ProgramTest method helloContract.
@Test
public void helloContract() {
ProgramResult result = TestContract.hello().executeFunction("hello", BigInteger.ZERO);
Assert.assertFalse(result.isRevert());
Assert.assertNull(result.getException());
Assert.assertArrayEquals(new String[] { "chinchilla" }, TestContract.hello().functions.get("hello").decodeResult(result.getHReturn()));
}
use of org.ethereum.vm.program.ProgramResult in project rskj by rsksmart.
the class ProgramTest method returnDataCopyTest.
@Test
public void returnDataCopyTest() {
TestContract contract = TestContract.returnDataTest();
ProgramResult result = contract.executeFunction("testCopy", BigInteger.ZERO);
Assert.assertFalse(result.isRevert());
Assert.assertNull(result.getException());
Assert.assertArrayEquals(new Object[] { LOREM_IPSUM }, contract.functions.get("testCopy").decodeResult(result.getHReturn()));
}
Aggregations