use of org.aion.solidity.SolidityType.AddressType in project aion by aionnetwork.
the class SolidityTypeTest method testAddress.
@Test
public void testAddress() throws Exception {
byte[] x = Hex.decode("1122334455667788112233445566778811223344556677881122334455667788");
byte[] params = new AddressType().encode(x);
System.out.println(Hex.toHexString(params));
AionTransaction tx = createTransaction(ByteUtil.merge(Hex.decode("42f45790"), params));
MiningBlock block = createDummyBlock();
RepositoryCache repo = createRepository(tx);
AionTxReceipt receipt = executeTransaction(tx, block, repo).getReceipt();
System.out.println(receipt);
assertArrayEquals(params, receipt.getTransactionOutput());
assertArrayEquals(x, (byte[]) new AddressType().decode(receipt.getTransactionOutput()));
}
Aggregations