Search in sources :

Example 1 with Transactions

use of com.github.rosklyar.client.account.domain.transaction.Transactions in project nem-library by rosklyar.

the class AccountClientTest method getAllTransactions.

@Test
void getAllTransactions() {
    Transactions transactions = accountClient.allTransactions(address);
    assertEquals(55000000, transactions.data.stream().mapToLong(pair -> pair.transaction.fee).sum());
    Transactions transactionsBeforeInputTransactionHash = accountClient.allTransactions(address, transactions.data.stream().findFirst().map(tr -> tr.meta.id).orElseThrow(RuntimeException::new));
    assertEquals(transactions.data.size() - 1, transactionsBeforeInputTransactionHash.data.size());
}
Also used : UnconfirmedTransactions(com.github.rosklyar.client.account.domain.transaction.UnconfirmedTransactions) Transactions(com.github.rosklyar.client.account.domain.transaction.Transactions) Test(org.junit.jupiter.api.Test)

Example 2 with Transactions

use of com.github.rosklyar.client.account.domain.transaction.Transactions in project nem-library by rosklyar.

the class AccountClientTest method getDecodedAllTransactions.

@Test
@Disabled("only for local NIS nodes")
void getDecodedAllTransactions() {
    Transactions transactions = accountClient.allDecodedTransactions(new AccountPrivateKeyTransactionsPage(privateKey, null, null));
    assertEquals("", transactions.data.stream().findFirst().map(pair -> pair.transaction.message.payload).orElse(null));
}
Also used : UnconfirmedTransactions(com.github.rosklyar.client.account.domain.transaction.UnconfirmedTransactions) Transactions(com.github.rosklyar.client.account.domain.transaction.Transactions) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 3 with Transactions

use of com.github.rosklyar.client.account.domain.transaction.Transactions in project nem-library by rosklyar.

the class AccountClientTest method getDecodedIncomingTransactions.

@Test
@Disabled("only for local NIS nodes")
void getDecodedIncomingTransactions() {
    Transactions transactions = accountClient.incomingDecodedTransactions(new AccountPrivateKeyTransactionsPage(privateKey, null, null));
    assertEquals("", transactions.data.stream().findFirst().map(pair -> pair.transaction.message.payload).orElse(null));
}
Also used : UnconfirmedTransactions(com.github.rosklyar.client.account.domain.transaction.UnconfirmedTransactions) Transactions(com.github.rosklyar.client.account.domain.transaction.Transactions) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 4 with Transactions

use of com.github.rosklyar.client.account.domain.transaction.Transactions in project nem-library by rosklyar.

the class AccountClientTest method getIncomingTransactions.

@Test
void getIncomingTransactions() {
    Transactions transactions = accountClient.incomingTransactions(address);
    assertEquals(2, transactions.data.size());
    Transactions transactionsBeforeInputTransactionHash = accountClient.incomingTransactions(address, transactions.data.stream().findFirst().map(tr -> tr.meta.id).orElseThrow(RuntimeException::new));
    assertEquals(transactions.data.size() - 1, transactionsBeforeInputTransactionHash.data.size());
}
Also used : UnconfirmedTransactions(com.github.rosklyar.client.account.domain.transaction.UnconfirmedTransactions) Transactions(com.github.rosklyar.client.account.domain.transaction.Transactions) Test(org.junit.jupiter.api.Test)

Example 5 with Transactions

use of com.github.rosklyar.client.account.domain.transaction.Transactions in project nem-library by rosklyar.

the class AccountClientTest method getOutgoingTransactions.

@Test
void getOutgoingTransactions() {
    Transactions transactions = accountClient.outgoingTransactions(address);
    assertEquals(26000000, transactions.data.stream().mapToLong(pair -> pair.transaction.fee).sum());
    Transactions transactionsBeforeInputTransactionHash = accountClient.outgoingTransactions(address, transactions.data.stream().findFirst().map(tr -> tr.meta.id).orElseThrow(RuntimeException::new));
    assertEquals(transactions.data.size() - 1, transactionsBeforeInputTransactionHash.data.size());
}
Also used : UnconfirmedTransactions(com.github.rosklyar.client.account.domain.transaction.UnconfirmedTransactions) Transactions(com.github.rosklyar.client.account.domain.transaction.Transactions) Test(org.junit.jupiter.api.Test)

Aggregations

Transactions (com.github.rosklyar.client.account.domain.transaction.Transactions)6 UnconfirmedTransactions (com.github.rosklyar.client.account.domain.transaction.UnconfirmedTransactions)6 Test (org.junit.jupiter.api.Test)6 Disabled (org.junit.jupiter.api.Disabled)3