use of io.nem.symbol.sdk.model.transaction.TransferTransaction in project nem2-sdk-java by nemtech.
the class TransactionMapperOkHttpTest method shouldCreateTransferEmptyMessage.
@Test
void shouldCreateTransferEmptyMessage() {
TransactionInfoDTO transferTransactionDTO = TestHelperOkHttp.loadTransactionInfoDTO("transferEmptyMessage.json");
TransferTransaction transferTransaction = (TransferTransaction) map(transferTransactionDTO);
validateStandaloneTransaction(transferTransaction, transferTransactionDTO);
Assertions.assertEquals("", transferTransaction.getMessage().get().getText());
}
use of io.nem.symbol.sdk.model.transaction.TransferTransaction in project nem2-sdk-java by nemtech.
the class TransactionMapperOkHttpTest method shouldCreateStandaloneTransferTransaction.
@Test
void shouldCreateStandaloneTransferTransaction() {
TransactionInfoDTO transferTransactionDTO = TestHelperOkHttp.loadTransactionInfoDTO("standaloneTransferTransaction.json");
Transaction transferTransaction = map(transferTransactionDTO);
validateStandaloneTransaction(transferTransaction, transferTransactionDTO);
}
use of io.nem.symbol.sdk.model.transaction.TransferTransaction in project nem2-sdk-java by nemtech.
the class AccountRepositoryIntegrationTest method outgoingTransactions.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void outgoingTransactions(RepositoryType type) {
TransactionRepository transactionRepository = getRepositoryFactory(type).createTransactionRepository();
PublicAccount recipient = this.helper().getTestAccount(type).getLeft().getPublicAccount();
List<Transaction> transactions = get(transactionRepository.search(new TransactionSearchCriteria(TransactionGroup.CONFIRMED).transactionTypes(Collections.singletonList(TransactionType.TRANSFER)).recipientAddress(recipient.getAddress()))).getData();
System.out.println(transactions.size());
transactions.forEach(transaction -> {
assertTransaction(transaction, null);
TransferTransaction transferTransaction = (TransferTransaction) transaction;
Assertions.assertEquals(recipient.getAddress(), transferTransaction.getRecipient());
});
}
use of io.nem.symbol.sdk.model.transaction.TransferTransaction in project nem2-sdk-java by nemtech.
the class AggregateTransactionServiceIntegrationTest method isTransferFromMultisigNotComplete.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void isTransferFromMultisigNotComplete(RepositoryType type) {
Account multisigAccount = helper().getMultisigAccount(type).getLeft();
TransferTransaction transferTransaction = TransferTransactionFactory.create(getNetworkType(), getDeadline(), getRecipient(), Collections.emptyList()).message(new PlainMessage("")).maxFee(maxFee).build();
AggregateTransaction aggregateTransaction = AggregateTransactionFactory.createComplete(getNetworkType(), getDeadline(), Collections.singletonList(transferTransaction.toAggregate(multisigAccount.getPublicAccount()))).maxFee(maxFee).build();
SignedTransaction signedAggregateTransaction = aggregateTransaction.signTransactionWithCosigners(multisigAccount, Collections.singletonList(config().getTestAccount()), getGenerationHash());
AggregateTransactionService aggregateTransactionService = new AggregateTransactionServiceImpl(getRepositoryFactory(type));
Assertions.assertFalse(get(aggregateTransactionService.isComplete(signedAggregateTransaction)));
}
use of io.nem.symbol.sdk.model.transaction.TransferTransaction in project nem2-sdk-java by nemtech.
the class ListenerIntegrationTest method announceStandaloneTransferTransactionWithInsufficientBalance.
private SignedTransaction announceStandaloneTransferTransactionWithInsufficientBalance(RepositoryType type) {
TransferTransaction transferTransaction = TransferTransactionFactory.create(getNetworkType(), getDeadline(), Address.generateRandom(getNetworkType()), Collections.singletonList(getNetworkCurrency().createRelative(new BigInteger("100000000000")))).message(new PlainMessage("test-message")).maxFee(maxFee).build();
SignedTransaction signedTransaction = this.account.sign(transferTransaction, getGenerationHash());
get(getTransactionRepository(type).announce(signedTransaction));
return signedTransaction;
}
Aggregations