Search in sources :

Example 6 with AggregateTransactionService

use of io.nem.symbol.sdk.api.AggregateTransactionService in project nem2-sdk-java by nemtech.

the class AggregateTransactionServiceIntegrationTest method isMultisigAccountModificationTransactionDeletionComplete.

@ParameterizedTest
@EnumSource(RepositoryType.class)
void isMultisigAccountModificationTransactionDeletionComplete(RepositoryType type) {
    Account multisigAccount = helper().getMultisigAccount(type).getLeft();
    Account cosignatoryAccount = config().getCosignatoryAccount();
    Account cosignatory2Account = config().getCosignatory2Account();
    List<Account> accounts = Arrays.asList(cosignatoryAccount, cosignatory2Account);
    MultisigAccountModificationTransaction multisigAccountModificationTransaction = MultisigAccountModificationTransactionFactory.create(getNetworkType(), getDeadline(), (byte) 1, (byte) 1, Collections.emptyList(), Collections.singletonList(accounts.get(0).getAddress())).maxFee(maxFee).build();
    AggregateTransaction aggregateTransaction = AggregateTransactionFactory.createComplete(getNetworkType(), getDeadline(), Collections.singletonList(multisigAccountModificationTransaction.toAggregate(multisigAccount.getPublicAccount()))).maxFee(maxFee).build();
    SignedTransaction signedAggregateTransaction = aggregateTransaction.signTransactionWithCosigners(multisigAccount, Collections.singletonList(accounts.get(1)), getGenerationHash());
    AggregateTransactionService aggregateTransactionService = new AggregateTransactionServiceImpl(getRepositoryFactory(type));
    Assertions.assertTrue(get(aggregateTransactionService.isComplete(signedAggregateTransaction)));
}
Also used : Account(io.nem.symbol.sdk.model.account.Account) MultisigAccountModificationTransaction(io.nem.symbol.sdk.model.transaction.MultisigAccountModificationTransaction) AggregateTransaction(io.nem.symbol.sdk.model.transaction.AggregateTransaction) AggregateTransactionService(io.nem.symbol.sdk.api.AggregateTransactionService) SignedTransaction(io.nem.symbol.sdk.model.transaction.SignedTransaction) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

AggregateTransactionService (io.nem.symbol.sdk.api.AggregateTransactionService)6 Account (io.nem.symbol.sdk.model.account.Account)6 AggregateTransaction (io.nem.symbol.sdk.model.transaction.AggregateTransaction)6 SignedTransaction (io.nem.symbol.sdk.model.transaction.SignedTransaction)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 EnumSource (org.junit.jupiter.params.provider.EnumSource)6 MultisigAccountModificationTransaction (io.nem.symbol.sdk.model.transaction.MultisigAccountModificationTransaction)4 UnresolvedAddress (io.nem.symbol.sdk.model.account.UnresolvedAddress)2 PlainMessage (io.nem.symbol.sdk.model.message.PlainMessage)2 TransferTransaction (io.nem.symbol.sdk.model.transaction.TransferTransaction)2