use of io.nem.symbol.catapult.builders.AggregateBondedTransactionBuilder in project nem2-sdk-java by nemtech.
the class AggregateTransactionTest method basicCatbufferDeserialization.
@Test
void basicCatbufferDeserialization() {
String expected = "A80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019041420000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
AggregateBondedTransactionBuilder transactionBuilder = (AggregateBondedTransactionBuilder) TransactionBuilderHelper.loadFromBinary(SerializationUtils.toDataInput(ConvertUtils.fromHexToBytes(expected)));
Assertions.assertEquals(expected, ConvertUtils.toHex(transactionBuilder.serialize()));
Assertions.assertEquals(0, transactionBuilder.getTransactions().size());
}
use of io.nem.symbol.catapult.builders.AggregateBondedTransactionBuilder in project nem2-sdk-java by nemtech.
the class AggregateTransactionTest method basicCatbufferAggregateSerialization.
@Test
void basicCatbufferAggregateSerialization() {
String expected = "6001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000190414200000000000000000100000000000000B4C97320255A2F755F6BE2F4DDAC0BB3EBDD25508DBE460EA6988366F404706AB8000000000000006D00000000000000F6503F78FBF99544B906872DDB392F4BE707180D285E7919DBACEF2E9573B1E6000000000190544190E8FEBD671DD41BEE94EC3BA5831CB608A312C2F203BA840D00010000000000672B0000CE560000640000000000000000536F6D65204D6573736167650000004100000000000000F6503F78FBF99544B906872DDB392F4BE707180D285E7919DBACEF2E9573B1E60000000001904D428869746E9B1A70570A000000000000000100000000000000";
BinarySerialization serialization = new BinarySerializationImpl();
AggregateTransaction deserialize = (AggregateTransaction) serialization.deserialize(ConvertUtils.fromHexToBytes(expected));
Assertions.assertEquals(2, deserialize.getInnerTransactions().size());
Assertions.assertEquals(0, deserialize.getCosignatures().size());
AggregateBondedTransactionBuilder transactionBuilder = AggregateBondedTransactionBuilder.loadFromBinary(SerializationUtils.toDataInput(ConvertUtils.fromHexToBytes(expected)));
Assertions.assertEquals(2, transactionBuilder.getTransactions().size());
Assertions.assertEquals(0, transactionBuilder.getCosignatures().size());
Assertions.assertEquals(expected, ConvertUtils.toHex(deserialize.serialize()));
Assertions.assertEquals(expected, ConvertUtils.toHex(transactionBuilder.serialize()));
}
use of io.nem.symbol.catapult.builders.AggregateBondedTransactionBuilder in project nem2-sdk-java by nemtech.
the class AggregateTransactionTest method basicCatbufferAggregateSerializationWithCosignatures.
@Test
void basicCatbufferAggregateSerializationWithCosignatures() {
String expected2 = "3002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000190414200000000000000000100000000000000B4C97320255A2F755F6BE2F4DDAC0BB3EBDD25508DBE460EA6988366F404706AB8000000000000006D00000000000000F6503F78FBF99544B906872DDB392F4BE707180D285E7919DBACEF2E9573B1E6000000000190544190E8FEBD671DD41BEE94EC3BA5831CB608A312C2F203BA840D00010000000000672B0000CE560000640000000000000000536F6D65204D6573736167650000004100000000000000F6503F78FBF99544B906872DDB392F4BE707180D285E7919DBACEF2E9573B1E60000000001904D428869746E9B1A70570A00000000000000010000000000000000000000000000009A49366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456111AAA9366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456111AAA9366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA6545611100000000000000009A49366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456222BBB9366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456222BBB9366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456222";
AggregateBondedTransactionBuilder transactionBuilder = (AggregateBondedTransactionBuilder) TransactionBuilderHelper.loadFromBinary(SerializationUtils.toDataInput(ConvertUtils.fromHexToBytes(expected2)));
Assertions.assertEquals(expected2, ConvertUtils.toHex(transactionBuilder.serialize()));
Assertions.assertEquals(2, transactionBuilder.getTransactions().size());
Assertions.assertEquals(2, transactionBuilder.getCosignatures().size());
}
Aggregations