Search in sources :

Example 11 with Transaction

use of io.nem.symbol.sdk.model.transaction.Transaction in project nem2-sdk-java by nemtech.

the class TransactionRepositoryVertxImplTest method searchTransactions.

@Test
public void searchTransactions() throws Exception {
    TransactionInfoDTO transferTransactionDTO = loadTransactionInfoDTO("standaloneTransferTransaction.json");
    PublicAccount publicAccount = Account.generateNewAccount(networkType).getPublicAccount();
    mockRemoteCall(toPage(transferTransactionDTO));
    Page<Transaction> transactions = repository.search(new TransactionSearchCriteria(TransactionGroup.UNCONFIRMED).signerPublicKey(publicAccount.getPublicKey())).toFuture().get();
    Assertions.assertEquals(TransactionType.TRANSFER, transactions.getData().get(0).getType());
    Assertions.assertEquals(TransactionGroup.UNCONFIRMED, transactions.getData().get(0).getGroup().get());
    Assertions.assertEquals(1, transactions.getData().size());
    Assertions.assertEquals(1, transactions.getPageNumber());
    Assertions.assertEquals(2, transactions.getPageSize());
}
Also used : SignedTransaction(io.nem.symbol.sdk.model.transaction.SignedTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) CosignatureSignedTransaction(io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction) TestHelperVertx.loadTransactionInfoDTO(io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) AnnounceTransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO) PublicAccount(io.nem.symbol.sdk.model.account.PublicAccount) TransactionSearchCriteria(io.nem.symbol.sdk.api.TransactionSearchCriteria) Test(org.junit.jupiter.api.Test)

Example 12 with Transaction

use of io.nem.symbol.sdk.model.transaction.Transaction in project nem2-sdk-java by nemtech.

the class TransactionRepositoryVertxImplTest method searchTransactionsTransactionTypes.

@Test
public void searchTransactionsTransactionTypes() throws Exception {
    TransactionInfoDTO transferTransactionDTO = loadTransactionInfoDTO("standaloneTransferTransaction.json");
    mockRemoteCall(toPage(transferTransactionDTO));
    TransactionSearchCriteria criteria = new TransactionSearchCriteria(TransactionGroup.CONFIRMED).transactionTypes(Arrays.asList(TransactionType.NAMESPACE_METADATA, TransactionType.AGGREGATE_COMPLETE));
    Page<Transaction> transactions = repository.search(criteria).toFuture().get();
    Assertions.assertEquals(TransactionType.TRANSFER, transactions.getData().get(0).getType());
    Assertions.assertEquals(TransactionGroup.CONFIRMED, transactions.getData().get(0).getGroup().get());
    Assertions.assertEquals(1, transactions.getData().size());
    Assertions.assertEquals(1, transactions.getPageNumber());
    Assertions.assertEquals(2, transactions.getPageSize());
}
Also used : SignedTransaction(io.nem.symbol.sdk.model.transaction.SignedTransaction) TransferTransaction(io.nem.symbol.sdk.model.transaction.TransferTransaction) Transaction(io.nem.symbol.sdk.model.transaction.Transaction) CosignatureSignedTransaction(io.nem.symbol.sdk.model.transaction.CosignatureSignedTransaction) TestHelperVertx.loadTransactionInfoDTO(io.nem.symbol.sdk.infrastructure.vertx.TestHelperVertx.loadTransactionInfoDTO) TransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.TransactionInfoDTO) AnnounceTransactionInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AnnounceTransactionInfoDTO) TransactionSearchCriteria(io.nem.symbol.sdk.api.TransactionSearchCriteria) Test(org.junit.jupiter.api.Test)

Example 13 with Transaction

use of io.nem.symbol.sdk.model.transaction.Transaction in project nem2-sdk-java by nemtech.

the class TransactionMapperVertxTest method shouldCreateAggregateRootNamespaceCreationTransaction.

@Test
void shouldCreateAggregateRootNamespaceCreationTransaction() {
    TransactionInfoDTO aggregateNamespaceCreationTransactionDTO = TestHelperVertx.loadTransactionInfoDTO("aggregateRootNamespaceCreationTransaction.json");
    Transaction aggregateNamespaceCreationTransaction = map(aggregateNamespaceCreationTransactionDTO);
    validateAggregateTransaction((AggregateTransaction) aggregateNamespaceCreationTransaction, aggregateNamespaceCreationTransactionDTO);
}
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 14 with Transaction

use of io.nem.symbol.sdk.model.transaction.Transaction in project nem2-sdk-java by nemtech.

the class TransactionMapperVertxTest method shouldCreateAggregateAddressAliasTransaction.

@Test
void shouldCreateAggregateAddressAliasTransaction() {
    TransactionInfoDTO aggregateTransferTransactionDTO = TestHelperVertx.loadTransactionInfoDTO("aggregateAddressAliasTransaction.json");
    Transaction aggregateTransferTransaction = map(aggregateTransferTransactionDTO);
    validateAggregateTransaction((AggregateTransaction) aggregateTransferTransaction, aggregateTransferTransactionDTO);
    AddressAliasTransaction transaction = (AddressAliasTransaction) ((AggregateTransaction) aggregateTransferTransaction).getInnerTransactions().get(0);
    Assertions.assertEquals("SDT4THYNVUQK2GM6XXYTWHZXSPE3AUA2GTDPM2Q", transaction.getAddress().plain());
    Assertions.assertEquals(AliasAction.LINK, 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) AddressAliasTransaction(io.nem.symbol.sdk.model.transaction.AddressAliasTransaction) AggregateTransaction(io.nem.symbol.sdk.model.transaction.AggregateTransaction) BigInteger(java.math.BigInteger) Test(org.junit.jupiter.api.Test)

Example 15 with Transaction

use of io.nem.symbol.sdk.model.transaction.Transaction in project nem2-sdk-java by nemtech.

the class TransactionMapperVertxTest method shouldCreateStandaloneMosaicCreationTransaction.

@Test
void shouldCreateStandaloneMosaicCreationTransaction() {
    TransactionInfoDTO mosaicCreationTransactionDTO = TestHelperVertx.loadTransactionInfoDTO("standaloneMosaicCreationTransaction.json");
    Transaction mosaicCreationTransaction = map(mosaicCreationTransactionDTO);
    validateStandaloneTransaction(mosaicCreationTransaction, mosaicCreationTransactionDTO);
}
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)

Aggregations

Transaction (io.nem.symbol.sdk.model.transaction.Transaction)125 TransferTransaction (io.nem.symbol.sdk.model.transaction.TransferTransaction)107 Test (org.junit.jupiter.api.Test)78 AggregateTransaction (io.nem.symbol.sdk.model.transaction.AggregateTransaction)70 HashLockTransaction (io.nem.symbol.sdk.model.transaction.HashLockTransaction)65 MultisigAccountModificationTransaction (io.nem.symbol.sdk.model.transaction.MultisigAccountModificationTransaction)60 MosaicDefinitionTransaction (io.nem.symbol.sdk.model.transaction.MosaicDefinitionTransaction)58 MosaicSupplyChangeTransaction (io.nem.symbol.sdk.model.transaction.MosaicSupplyChangeTransaction)58 AddressAliasTransaction (io.nem.symbol.sdk.model.transaction.AddressAliasTransaction)57 MosaicAliasTransaction (io.nem.symbol.sdk.model.transaction.MosaicAliasTransaction)57 NamespaceRegistrationTransaction (io.nem.symbol.sdk.model.transaction.NamespaceRegistrationTransaction)57 AccountAddressRestrictionTransaction (io.nem.symbol.sdk.model.transaction.AccountAddressRestrictionTransaction)55 AccountMosaicRestrictionTransaction (io.nem.symbol.sdk.model.transaction.AccountMosaicRestrictionTransaction)55 MosaicMetadataTransaction (io.nem.symbol.sdk.model.transaction.MosaicMetadataTransaction)55 SecretLockTransaction (io.nem.symbol.sdk.model.transaction.SecretLockTransaction)55 SecretProofTransaction (io.nem.symbol.sdk.model.transaction.SecretProofTransaction)55 AccountKeyLinkTransaction (io.nem.symbol.sdk.model.transaction.AccountKeyLinkTransaction)54 AccountMetadataTransaction (io.nem.symbol.sdk.model.transaction.AccountMetadataTransaction)54 AccountOperationRestrictionTransaction (io.nem.symbol.sdk.model.transaction.AccountOperationRestrictionTransaction)54 NamespaceMetadataTransaction (io.nem.symbol.sdk.model.transaction.NamespaceMetadataTransaction)54