use of org.aion.solidity.SolidityType.IntType in project aion by aionnetwork.
the class SolidityTypeTest method testInt.
@Test
public void testInt() throws Exception {
BigInteger bi = new BigInteger(1, Hex.decode("ffffffffffffffffffffffff"));
byte[] params = new IntType("int96").encode(bi);
System.out.println(Hex.toHexString(params));
AionTransaction tx = createTransaction(ByteUtil.merge(Hex.decode("6761755c"), params));
MiningBlock block = createDummyBlock();
RepositoryCache repo = createRepository(tx);
AionTxReceipt receipt = executeTransaction(tx, block, repo).getReceipt();
System.out.println(receipt);
assertArrayEquals(Hex.decode("00000000ffffffffffffffffffffffff"), receipt.getTransactionOutput());
assertEquals(bi, new IntType("int96").decode(receipt.getTransactionOutput()));
}
Aggregations