use of io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionMapperOkHttpTest method shouldCreateAggregateAccountKeyLinkTransaction.
@Test
void shouldCreateAggregateAccountKeyLinkTransaction() {
TransactionInfoDTO aggregateTransferTransactionDTO = TestHelperOkHttp.loadTransactionInfoDTO("aggregateAccountKeyLinkTransaction.json");
Transaction aggregateTransferTransaction = map(aggregateTransferTransactionDTO);
validateAggregateTransaction((AggregateTransaction) aggregateTransferTransaction, aggregateTransferTransactionDTO);
AccountKeyLinkTransaction transaction = (AccountKeyLinkTransaction) ((AggregateTransaction) aggregateTransferTransaction).getInnerTransactions().get(0);
Assertions.assertEquals(LinkAction.LINK, transaction.getLinkAction());
Assertions.assertEquals("SARNASAS2BIAB6LMFA3FPMGBPGIJGK6IJETM3ZQ", PublicAccount.createFromPublicKey(transaction.getLinkedPublicKey().toHex(), transaction.getNetworkType()).getAddress().plain());
}
use of io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionMapperOkHttpTest method shouldCreateAccountAddressRestriction.
@Test
public void shouldCreateAccountAddressRestriction() {
TransactionInfoDTO transactionInfoDTO = TestHelperOkHttp.loadTransactionInfoDTO("accountAddressRestrictionTransaction.json");
AccountAddressRestrictionTransaction transaction = (AccountAddressRestrictionTransaction) map(transactionInfoDTO);
validateStandaloneTransaction(transaction, transactionInfoDTO);
Assertions.assertEquals(AccountAddressRestrictionFlags.ALLOW_INCOMING_ADDRESS, transaction.getRestrictionFlags());
Assertions.assertEquals(1, transaction.getRestrictionAdditions().size());
Assertions.assertEquals(MapperUtils.toAddress("90DD539FC43C3703715A7445EA9188544F9086BC93A22465"), transaction.getRestrictionAdditions().get(0));
Assertions.assertEquals(MapperUtils.toAddress("9067C932B35C128FB23AAD0153036FF8DA44E52448D2E633"), transaction.getRestrictionDeletions().get(0));
}
use of io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionMapperOkHttpTest method shouldCreateAggregateNamespaceMetadataTransaction.
@Test
void shouldCreateAggregateNamespaceMetadataTransaction() {
TransactionInfoDTO aggregateTransferTransactionDTO = TestHelperOkHttp.loadTransactionInfoDTO("aggregateNamespaceMetadataTransaction.json");
AggregateTransaction aggregateTransferTransaction = (AggregateTransaction) map(aggregateTransferTransactionDTO);
validateAggregateTransaction(aggregateTransferTransaction, aggregateTransferTransactionDTO);
NamespaceMetadataTransaction transaction = (NamespaceMetadataTransaction) aggregateTransferTransaction.getInnerTransactions().get(0);
Assertions.assertEquals("90E6FF7755A80B6AA935A5C31B6D3D0CFAF82E06BF2B9CC9", transaction.getTargetAddress().encoded(transaction.getNetworkType()));
Assertions.assertEquals(-1, transaction.getValueSizeDelta());
Assertions.assertEquals(new BigInteger("11529215046069664444"), transaction.getScopedMetadataKey());
Assertions.assertArrayEquals(StringEncoder.getBytes("This is the message for this account! 汉字89664"), transaction.getValue());
Assertions.assertEquals("0003070467832AAA", transaction.getTargetNamespaceId().getIdAsHex());
}
use of io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionMapperOkHttpTest method shouldCreateStandaloneSecretProofTransaction.
@Test
void shouldCreateStandaloneSecretProofTransaction() {
TransactionInfoDTO secretProofTransactionDTO = TestHelperOkHttp.loadTransactionInfoDTO("standaloneSecretProofTransaction.json");
Transaction secretProofTransaction = map(secretProofTransactionDTO);
validateStandaloneTransaction(secretProofTransaction, secretProofTransactionDTO);
}
use of io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionMapperOkHttpTest method shouldCreateAggregateAccountMetadataTransaction.
@Test
void shouldCreateAggregateAccountMetadataTransaction() {
TransactionInfoDTO aggregateTransferTransactionDTO = TestHelperOkHttp.loadTransactionInfoDTO("aggregateAccountMetadataTransaction.json");
AggregateTransaction aggregateTransferTransaction = (AggregateTransaction) map(aggregateTransferTransactionDTO);
validateAggregateTransaction(aggregateTransferTransaction, aggregateTransferTransactionDTO);
AccountMetadataTransaction transaction = (AccountMetadataTransaction) aggregateTransferTransaction.getInnerTransactions().get(0);
Assertions.assertEquals("90E6FF7755A80B6AA935A5C31B6D3D0CFAF82E06BF2B9CC9", transaction.getTargetAddress().encoded(transaction.getNetworkType()));
Assertions.assertEquals(-1, transaction.getValueSizeDelta());
Assertions.assertEquals(new BigInteger("11529215046069664444"), transaction.getScopedMetadataKey());
Assertions.assertArrayEquals(StringEncoder.getBytes("This is the message for this account! 汉字89664"), transaction.getValue());
}
Aggregations