Search in sources :

Example 6 with TransactionInfoDTO

use of io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO in project nem2-sdk-java by nemtech.

the class TransactionMapperVertxTest method shouldCreateStandaloneMosaicGlobalRestrictionTransaction.

@Test
void shouldCreateStandaloneMosaicGlobalRestrictionTransaction() {
    TransactionInfoDTO mosaicGlobalRestrictionTransactionDTO = TestHelperVertx.loadTransactionInfoDTO("standaloneMosaicGlobalRestrictionTransaction.json");
    Transaction mosaicGlobalRestrictionTransaction = map(mosaicGlobalRestrictionTransactionDTO);
    validateStandaloneTransaction(mosaicGlobalRestrictionTransaction, mosaicGlobalRestrictionTransactionDTO);
}
Also used : SecretProofTransaction(io.nem.symbol.sdk.model.transaction.SecretProofTransaction) HashLockTransaction(io.nem.symbol.sdk.model.transaction.HashLockTransaction) AccountOperationRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransaction) AccountAddressRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountAddressRestrictionTransaction) AggregateTransaction(io.nem.symbol.sdk.model.transaction.AggregateTransaction) NamespaceRegistrationTransaction(io.nem.symbol.sdk.model.transaction.NamespaceRegistrationTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) MosaicDefinitionTransaction(io.nem.symbol.sdk.model.transaction.MosaicDefinitionTransaction) MultisigAccountModificationTransaction(io.nem.symbol.sdk.model.transaction.MultisigAccountModificationTransaction) AccountMosaicRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountMosaicRestrictionTransaction) MosaicMetadataTransaction(io.nem.symbol.sdk.model.transaction.MosaicMetadataTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) AccountKeyLinkTransaction(io.nem.symbol.sdk.model.transaction.AccountKeyLinkTransaction) NamespaceMetadataTransaction(io.nem.symbol.sdk.model.transaction.NamespaceMetadataTransaction) AccountMetadataTransaction(io.nem.symbol.sdk.model.transaction.AccountMetadataTransaction) AddressAliasTransaction(io.nem.symbol.sdk.model.transaction.AddressAliasTransaction) MosaicAliasTransaction(io.nem.symbol.sdk.model.transaction.MosaicAliasTransaction) MosaicSupplyChangeTransaction(io.nem.symbol.sdk.model.transaction.MosaicSupplyChangeTransaction) SecretLockTransaction(io.nem.symbol.sdk.model.transaction.SecretLockTransaction) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) Test(org.junit.jupiter.api.Test)

Example 7 with TransactionInfoDTO

use of io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO in project nem2-sdk-java by nemtech.

the class TransactionMapperVertxTest method shouldCreateAggregateMosaicGlobalRestrictionTransaction.

@Test
void shouldCreateAggregateMosaicGlobalRestrictionTransaction() {
    TransactionInfoDTO aggregateMosaicGlobalRestrictionTransactionDTO = TestHelperVertx.loadTransactionInfoDTO("aggregateMosaicGlobalRestrictionTransaction.json");
    Transaction aggregateMosaicGlobalRestrictionTransaction = map(aggregateMosaicGlobalRestrictionTransactionDTO);
    validateAggregateTransaction((AggregateTransaction) aggregateMosaicGlobalRestrictionTransaction, aggregateMosaicGlobalRestrictionTransactionDTO);
}
Also used : SecretProofTransaction(io.nem.symbol.sdk.model.transaction.SecretProofTransaction) HashLockTransaction(io.nem.symbol.sdk.model.transaction.HashLockTransaction) AccountOperationRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransaction) AccountAddressRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountAddressRestrictionTransaction) AggregateTransaction(io.nem.symbol.sdk.model.transaction.AggregateTransaction) NamespaceRegistrationTransaction(io.nem.symbol.sdk.model.transaction.NamespaceRegistrationTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) MosaicDefinitionTransaction(io.nem.symbol.sdk.model.transaction.MosaicDefinitionTransaction) MultisigAccountModificationTransaction(io.nem.symbol.sdk.model.transaction.MultisigAccountModificationTransaction) AccountMosaicRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountMosaicRestrictionTransaction) MosaicMetadataTransaction(io.nem.symbol.sdk.model.transaction.MosaicMetadataTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) AccountKeyLinkTransaction(io.nem.symbol.sdk.model.transaction.AccountKeyLinkTransaction) NamespaceMetadataTransaction(io.nem.symbol.sdk.model.transaction.NamespaceMetadataTransaction) AccountMetadataTransaction(io.nem.symbol.sdk.model.transaction.AccountMetadataTransaction) AddressAliasTransaction(io.nem.symbol.sdk.model.transaction.AddressAliasTransaction) MosaicAliasTransaction(io.nem.symbol.sdk.model.transaction.MosaicAliasTransaction) MosaicSupplyChangeTransaction(io.nem.symbol.sdk.model.transaction.MosaicSupplyChangeTransaction) SecretLockTransaction(io.nem.symbol.sdk.model.transaction.SecretLockTransaction) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) Test(org.junit.jupiter.api.Test)

Example 8 with TransactionInfoDTO

use of io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO in project nem2-sdk-java by nemtech.

the class TransactionMapperVertxTest method shouldCreateAggregateMosaicAliasTransaction.

@Test
void shouldCreateAggregateMosaicAliasTransaction() {
    TransactionInfoDTO aggregateTransferTransactionDTO = TestHelperVertx.loadTransactionInfoDTO("aggregateMosaicAliasTransaction.json");
    Transaction aggregateTransferTransaction = map(aggregateTransferTransactionDTO);
    validateAggregateTransaction((AggregateTransaction) aggregateTransferTransaction, aggregateTransferTransactionDTO);
    MosaicAliasTransaction transaction = (MosaicAliasTransaction) ((AggregateTransaction) aggregateTransferTransaction).getInnerTransactions().get(0);
    Assertions.assertEquals(new BigInteger("884562898459306"), transaction.getMosaicId().getId());
    Assertions.assertEquals(AliasAction.UNLINK, transaction.getAliasAction());
    Assertions.assertEquals(new BigInteger("307262000798378"), transaction.getNamespaceId().getId());
}
Also used : SecretProofTransaction(io.nem.symbol.sdk.model.transaction.SecretProofTransaction) HashLockTransaction(io.nem.symbol.sdk.model.transaction.HashLockTransaction) AccountOperationRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransaction) AccountAddressRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountAddressRestrictionTransaction) AggregateTransaction(io.nem.symbol.sdk.model.transaction.AggregateTransaction) NamespaceRegistrationTransaction(io.nem.symbol.sdk.model.transaction.NamespaceRegistrationTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) MosaicDefinitionTransaction(io.nem.symbol.sdk.model.transaction.MosaicDefinitionTransaction) MultisigAccountModificationTransaction(io.nem.symbol.sdk.model.transaction.MultisigAccountModificationTransaction) AccountMosaicRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountMosaicRestrictionTransaction) MosaicMetadataTransaction(io.nem.symbol.sdk.model.transaction.MosaicMetadataTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) AccountKeyLinkTransaction(io.nem.symbol.sdk.model.transaction.AccountKeyLinkTransaction) NamespaceMetadataTransaction(io.nem.symbol.sdk.model.transaction.NamespaceMetadataTransaction) AccountMetadataTransaction(io.nem.symbol.sdk.model.transaction.AccountMetadataTransaction) AddressAliasTransaction(io.nem.symbol.sdk.model.transaction.AddressAliasTransaction) MosaicAliasTransaction(io.nem.symbol.sdk.model.transaction.MosaicAliasTransaction) MosaicSupplyChangeTransaction(io.nem.symbol.sdk.model.transaction.MosaicSupplyChangeTransaction) SecretLockTransaction(io.nem.symbol.sdk.model.transaction.SecretLockTransaction) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) AggregateTransaction(io.nem.symbol.sdk.model.transaction.AggregateTransaction) BigInteger(java.math.BigInteger) MosaicAliasTransaction(io.nem.symbol.sdk.model.transaction.MosaicAliasTransaction) Test(org.junit.jupiter.api.Test)

Example 9 with TransactionInfoDTO

use of io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO in project nem2-sdk-java by nemtech.

the class TransactionMapperVertxTest method shouldCreateStandaloneLockFundsTransaction.

@Test
void shouldCreateStandaloneLockFundsTransaction() {
    TransactionInfoDTO lockFundsTransactionDTO = TestHelperVertx.loadTransactionInfoDTO("standaloneLockFundsTransaction.json");
    Transaction lockFundsTransaction = map(lockFundsTransactionDTO);
    validateStandaloneTransaction(lockFundsTransaction, lockFundsTransactionDTO);
}
Also used : SecretProofTransaction(io.nem.symbol.sdk.model.transaction.SecretProofTransaction) HashLockTransaction(io.nem.symbol.sdk.model.transaction.HashLockTransaction) AccountOperationRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransaction) AccountAddressRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountAddressRestrictionTransaction) AggregateTransaction(io.nem.symbol.sdk.model.transaction.AggregateTransaction) NamespaceRegistrationTransaction(io.nem.symbol.sdk.model.transaction.NamespaceRegistrationTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) MosaicDefinitionTransaction(io.nem.symbol.sdk.model.transaction.MosaicDefinitionTransaction) MultisigAccountModificationTransaction(io.nem.symbol.sdk.model.transaction.MultisigAccountModificationTransaction) AccountMosaicRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountMosaicRestrictionTransaction) MosaicMetadataTransaction(io.nem.symbol.sdk.model.transaction.MosaicMetadataTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) AccountKeyLinkTransaction(io.nem.symbol.sdk.model.transaction.AccountKeyLinkTransaction) NamespaceMetadataTransaction(io.nem.symbol.sdk.model.transaction.NamespaceMetadataTransaction) AccountMetadataTransaction(io.nem.symbol.sdk.model.transaction.AccountMetadataTransaction) AddressAliasTransaction(io.nem.symbol.sdk.model.transaction.AddressAliasTransaction) MosaicAliasTransaction(io.nem.symbol.sdk.model.transaction.MosaicAliasTransaction) MosaicSupplyChangeTransaction(io.nem.symbol.sdk.model.transaction.MosaicSupplyChangeTransaction) SecretLockTransaction(io.nem.symbol.sdk.model.transaction.SecretLockTransaction) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) Test(org.junit.jupiter.api.Test)

Example 10 with TransactionInfoDTO

use of io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO in project nem2-sdk-java by nemtech.

the class TransactionMapperVertxTest method shouldCreateAccountAddressRestriction.

@Test
public void shouldCreateAccountAddressRestriction() throws Exception {
    TransactionInfoDTO transactionInfoDTO = TestHelperVertx.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));
}
Also used : TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) AccountAddressRestrictionTransaction(io.nem.symbol.sdk.model.transaction.AccountAddressRestrictionTransaction) Test(org.junit.jupiter.api.Test)

Aggregations

TransactionInfoDTO (io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO)55 Test (org.junit.jupiter.api.Test)46 Transaction (io.nem.symbol.sdk.model.transaction.Transaction)40 TransferTransaction (io.nem.symbol.sdk.model.transaction.TransferTransaction)36 AggregateTransaction (io.nem.symbol.sdk.model.transaction.AggregateTransaction)32 AccountAddressRestrictionTransaction (io.nem.symbol.sdk.model.transaction.AccountAddressRestrictionTransaction)28 AccountMetadataTransaction (io.nem.symbol.sdk.model.transaction.AccountMetadataTransaction)28 AccountMosaicRestrictionTransaction (io.nem.symbol.sdk.model.transaction.AccountMosaicRestrictionTransaction)28 AccountOperationRestrictionTransaction (io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransaction)28 MosaicMetadataTransaction (io.nem.symbol.sdk.model.transaction.MosaicMetadataTransaction)28 NamespaceMetadataTransaction (io.nem.symbol.sdk.model.transaction.NamespaceMetadataTransaction)28 AccountKeyLinkTransaction (io.nem.symbol.sdk.model.transaction.AccountKeyLinkTransaction)27 AddressAliasTransaction (io.nem.symbol.sdk.model.transaction.AddressAliasTransaction)27 HashLockTransaction (io.nem.symbol.sdk.model.transaction.HashLockTransaction)27 MosaicAliasTransaction (io.nem.symbol.sdk.model.transaction.MosaicAliasTransaction)27 MosaicDefinitionTransaction (io.nem.symbol.sdk.model.transaction.MosaicDefinitionTransaction)27 MosaicSupplyChangeTransaction (io.nem.symbol.sdk.model.transaction.MosaicSupplyChangeTransaction)27 MultisigAccountModificationTransaction (io.nem.symbol.sdk.model.transaction.MultisigAccountModificationTransaction)27 NamespaceRegistrationTransaction (io.nem.symbol.sdk.model.transaction.NamespaceRegistrationTransaction)27 SecretLockTransaction (io.nem.symbol.sdk.model.transaction.SecretLockTransaction)27