use of com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId in project hedera-mirror-node by hashgraph.
the class TokenFeature method dissociateAccounts.
private void dissociateAccounts(TokenId tokenId, List<ExpandedAccountId> accountIds) {
for (ExpandedAccountId accountId : accountIds) {
try {
tokenClient.dissociate(accountId, tokenId);
log.info("Successfully dissociated account {} from token {}", accountId, tokenId);
} catch (Exception ex) {
log.warn("Error dissociating account {} from token {}, error: {}", accountId, tokenId, ex);
}
}
}
use of com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId in project hedera-mirror-node by hashgraph.
the class TokenFeature method transferNftsToRecipient.
@Then("^I transfer serial number (?:(.*) )?of token (?:(.*) )?to recipient(?: (.*))?$")
public void transferNftsToRecipient(Integer serialNumberIndex, Integer tokenIndex, Integer recipientIndex) {
ExpandedAccountId payer = tokenClient.getSdkClient().getExpandedOperatorAccountId();
TokenId tokenId = tokenIds.get(getIndexOrDefault(tokenIndex));
transferNfts(tokenId, tokenSerialNumbers.get(tokenId).get(getIndexOrDefault(serialNumberIndex)), payer, recipients.get(getIndexOrDefault(recipientIndex)).getAccountId());
}
use of com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId in project hedera-mirror-node by hashgraph.
the class ScheduleFeature method createNewCryptoAccountSchedule.
@Given("I successfully schedule a crypto account create")
public void createNewCryptoAccountSchedule() {
expectedSignersCount = 1;
currentSignersCount = 0 + signatoryCountOffset;
ExpandedAccountId alice = accountClient.getAccount(AccountClient.AccountNameEnum.ALICE);
scheduledTransaction = accountClient.getAccountCreateTransaction(Hbar.fromTinybars(DEFAULT_TINY_HBAR), KeyList.of(alice.getPublicKey()), true, "scheduled case");
createNewSchedule(scheduledTransaction, null);
}
use of com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId in project hedera-mirror-node by hashgraph.
the class ScheduleFeature method createNewTokenTransferSchedule.
@Given("I successfully schedule a token transfer from {string} to {string}")
public void createNewTokenTransferSchedule(String senderName, String receiverName) {
expectedSignersCount = 2;
currentSignersCount = 0 + signatoryCountOffset;
tokenTreasuryAccount = accountClient.getAccount(AccountClient.AccountNameEnum.valueOf(senderName));
ExpandedAccountId receiver = accountClient.getAccount(AccountClient.AccountNameEnum.valueOf(receiverName));
createAndAssociateToken(TokenType.FUNGIBLE_COMMON, DEFAULT_TINY_HBAR, receiverName, receiver);
Hbar hbarAmount = Hbar.fromTinybars(DEFAULT_TINY_HBAR);
scheduledTransaction = tokenClient.getFungibleTokenTransferTransaction(tokenId, tokenTreasuryAccount.getAccountId(), receiver.getAccountId(), 10).addHbarTransfer(receiver.getAccountId(), hbarAmount).addHbarTransfer(tokenTreasuryAccount.getAccountId(), hbarAmount.negated());
createNewSchedule(scheduledTransaction, null);
}
use of com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId in project hedera-mirror-node by hashgraph.
the class ScheduleFeature method createNewNftTransferSchedule.
@Given("I successfully schedule an nft transfer from {string} to {string}")
public void createNewNftTransferSchedule(String senderName, String receiverName) {
expectedSignersCount = 2;
currentSignersCount = 0 + signatoryCountOffset;
tokenTreasuryAccount = accountClient.getAccount(AccountClient.AccountNameEnum.valueOf(senderName));
ExpandedAccountId receiver = accountClient.getAccount(AccountClient.AccountNameEnum.valueOf(receiverName));
createAndAssociateToken(TokenType.NON_FUNGIBLE_UNIQUE, 0, receiverName, receiver);
networkTransactionResponse = tokenClient.mint(tokenId, 0, RandomUtils.nextBytes(4));
assertNotNull(networkTransactionResponse.getTransactionId());
assertNotNull(networkTransactionResponse.getReceipt());
serialNumber = networkTransactionResponse.getReceipt().serials.get(0);
scheduledTransaction = tokenClient.getNonFungibleTokenTransferTransaction(tokenId, tokenTreasuryAccount.getAccountId(), receiver.getAccountId(), Arrays.asList(serialNumber));
createNewSchedule(scheduledTransaction, null);
}
Aggregations