use of io.nem.symbol.sdk.model.account.Account 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)));
}
use of io.nem.symbol.sdk.model.account.Account in project nem2-sdk-java by nemtech.
the class AccountRepositoryIntegrationTest method getAccountInfo.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void getAccountInfo(RepositoryType type) {
Account testAccount = this.config().getDefaultAccount();
Observable<AccountInfo> accountInfo1 = this.getAccountRepository(type).getAccountInfo(testAccount.getPublicAccount().getAddress());
AccountInfo accountInfo = get(accountInfo1);
assertEquals(testAccount.getPublicKey(), accountInfo.getPublicKey().toHex());
assertEquals(AccountType.UNLINKED, accountInfo.getAccountType());
}
use of io.nem.symbol.sdk.model.account.Account in project nem2-sdk-java by nemtech.
the class AccountRepositoryIntegrationTest method getMosaicGlobalRegistration.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void getMosaicGlobalRegistration(RepositoryType type) {
TransactionRepository transactionRepository = getRepositoryFactory(type).createTransactionRepository();
Account account = config().getDefaultAccount();
TransactionType transactionType = TransactionType.MOSAIC_GLOBAL_RESTRICTION;
List<Transaction> transactions = get(transactionRepository.search(new TransactionSearchCriteria(TransactionGroup.CONFIRMED).transactionTypes(Collections.singletonList(transactionType)).signerPublicKey(account.getPublicAccount().getPublicKey()).pageSize(10))).getData();
System.out.println(transactions.size());
Assertions.assertFalse(transactions.isEmpty());
transactions.forEach(t -> Assertions.assertEquals(transactionType, t.getType()));
}
use of io.nem.symbol.sdk.model.account.Account in project nem2-sdk-java by nemtech.
the class AAASetupIntegrationTest method createMultisigAccountBondedUsingNemesis.
@Test
@Order(7)
void createMultisigAccountBondedUsingNemesis() {
Account multisig = config().getNemesisAccount8();
RepositoryFactory repositoryFactory = getRepositoryFactory(DEFAULT_REPOSITORY_TYPE);
MultisigAccountInfo info = helper().createMultisigAccountBonded(type, multisig, config().getNemesisAccount9(), config().getNemesisAccount10());
StateProofService service = new StateProofServiceImpl(repositoryFactory);
StateMerkleProof<MultisigAccountInfo> proof = get(service.multisig(info));
Assertions.assertTrue(proof.isValid());
}
use of io.nem.symbol.sdk.model.account.Account in project nem2-sdk-java by nemtech.
the class AAASetupIntegrationTest method createMultisigAccountCompleteUsingNemesis.
@Test
@Order(6)
void createMultisigAccountCompleteUsingNemesis() {
Account multisig = config().getNemesisAccount8();
System.out.println(multisig.getAddress().plain());
RepositoryFactory repositoryFactory = getRepositoryFactory(DEFAULT_REPOSITORY_TYPE);
MultisigAccountInfo info = helper().createMultisigAccountComplete(type, multisig, config().getNemesisAccount9(), config().getNemesisAccount10());
StateProofService service = new StateProofServiceImpl(repositoryFactory);
StateMerkleProof<MultisigAccountInfo> proof = get(service.multisig(info));
Assertions.assertTrue(proof.isValid());
}
Aggregations