Search in sources :

Example 6 with TokenId

use of com.hedera.hashgraph.sdk.TokenId in project hedera-mirror-node by hashgraph.

the class TokenFeature method verifyMirrorNftFundFlow.

@Then("^the mirror node REST API should return status (.*) for token (:?(.*) )?serial number (:?(.*) )?full flow$")
@Retryable(value = { AssertionError.class }, backoff = @Backoff(delayExpression = "#{@restPollingProperties.minBackoff.toMillis()}"), maxAttemptsExpression = "#{@restPollingProperties.maxAttempts}")
public void verifyMirrorNftFundFlow(int status, Integer tokenIndex, Integer serialNumberIndex) {
    TokenId tokenId = tokenIds.get(getIndexOrDefault(tokenIndex));
    Long serialNumber = tokenSerialNumbers.get(tokenId).get(getIndexOrDefault(serialNumberIndex));
    verifyTransactions(status);
    verifyToken(tokenId);
    verifyNft(tokenId, serialNumber);
    verifyNftTransfers(tokenId, serialNumber);
    verifyNftTransactions(tokenId, serialNumber);
    publishBackgroundMessages();
}
Also used : TokenId(com.hedera.hashgraph.sdk.TokenId) Retryable(org.springframework.retry.annotation.Retryable) Then(io.cucumber.java.en.Then)

Example 7 with TokenId

use of com.hedera.hashgraph.sdk.TokenId in project hedera-mirror-node by hashgraph.

the class TokenFeature method wipeNft.

@Given("I wipe serial number {int} from token {int}")
public void wipeNft(int serialNumberIndex, int tokenIndex) {
    TokenId tokenId = tokenIds.get(tokenIndex);
    networkTransactionResponse = tokenClient.wipeNonFungible(tokenId, tokenSerialNumbers.get(tokenId).get(serialNumberIndex), recipients.get(0));
    assertNotNull(networkTransactionResponse.getTransactionId());
    assertNotNull(networkTransactionResponse.getReceipt());
}
Also used : TokenId(com.hedera.hashgraph.sdk.TokenId) Given(io.cucumber.java.en.Given)

Example 8 with TokenId

use of com.hedera.hashgraph.sdk.TokenId in project hedera-mirror-node by hashgraph.

the class TokenFeature method createNewNft.

private void createNewNft(String symbol, int freezeStatus, int kycStatus, TokenSupplyType tokenSupplyType) {
    TokenId tokenId = createNewToken(symbol, freezeStatus, kycStatus, TokenType.NON_FUNGIBLE_UNIQUE, tokenSupplyType, Collections.emptyList());
    tokenSerialNumbers.put(tokenId, new ArrayList<>());
}
Also used : TokenId(com.hedera.hashgraph.sdk.TokenId)

Example 9 with TokenId

use of com.hedera.hashgraph.sdk.TokenId in project hedera-mirror-node by hashgraph.

the class TokenFeature method verifyMirrorTokenFundFlow.

@Then("^the mirror node REST API should return status (.*) for token (:?(.*) )?fund flow with assessed custom " + "fees$")
@Retryable(value = { AssertionError.class }, backoff = @Backoff(delayExpression = "#{@restPollingProperties.minBackoff.toMillis()}"), maxAttemptsExpression = "#{@restPollingProperties.maxAttempts}")
public void verifyMirrorTokenFundFlow(int status, Integer tokenIndex, List<MirrorAssessedCustomFee> assessedCustomFees) {
    TokenId tokenId = tokenIds.get(getIndexOrDefault(tokenIndex));
    verifyTransactions(status, assessedCustomFees);
    verifyToken(tokenId);
    verifyTokenTransfers(tokenId);
    publishBackgroundMessages();
}
Also used : TokenId(com.hedera.hashgraph.sdk.TokenId) Retryable(org.springframework.retry.annotation.Retryable) Then(io.cucumber.java.en.Then)

Example 10 with TokenId

use of com.hedera.hashgraph.sdk.TokenId in project hedera-mirror-node by hashgraph.

the class TokenFeature method createNewToken.

private TokenId createNewToken(String symbol, int freezeStatus, int kycStatus, TokenType tokenType, TokenSupplyType tokenSupplyType, List<CustomFee> customFees) {
    ExpandedAccountId admin = tokenClient.getSdkClient().getExpandedOperatorAccountId();
    networkTransactionResponse = tokenClient.createToken(admin, symbol, freezeStatus, kycStatus, admin, INITIAL_SUPPLY, tokenSupplyType, MAX_SUPPLY, tokenType, customFees);
    assertNotNull(networkTransactionResponse.getTransactionId());
    assertNotNull(networkTransactionResponse.getReceipt());
    TokenId tokenId = networkTransactionResponse.getReceipt().tokenId;
    assertNotNull(tokenId);
    tokenIds.add(tokenId);
    tokenCustomFees.put(tokenId, customFees);
    return tokenId;
}
Also used : ExpandedAccountId(com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId) TokenId(com.hedera.hashgraph.sdk.TokenId)

Aggregations

TokenId (com.hedera.hashgraph.sdk.TokenId)17 Then (io.cucumber.java.en.Then)5 TokenCreateTransaction (com.hedera.hashgraph.sdk.TokenCreateTransaction)4 ExpandedAccountId (com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId)4 Given (io.cucumber.java.en.Given)4 Retryable (org.springframework.retry.annotation.Retryable)4 TransferTransaction (com.hedera.hashgraph.sdk.TransferTransaction)3 AccountCreateTransaction (com.hedera.hashgraph.sdk.AccountCreateTransaction)2 AccountDeleteTransaction (com.hedera.hashgraph.sdk.AccountDeleteTransaction)2 AccountId (com.hedera.hashgraph.sdk.AccountId)2 Client (com.hedera.hashgraph.sdk.Client)2 Hbar (com.hedera.hashgraph.sdk.Hbar)2 PrivateKey (com.hedera.hashgraph.sdk.PrivateKey)2 TokenAssociateTransaction (com.hedera.hashgraph.sdk.TokenAssociateTransaction)2 TokenDeleteTransaction (com.hedera.hashgraph.sdk.TokenDeleteTransaction)2 TransactionReceipt (com.hedera.hashgraph.sdk.TransactionReceipt)2 NetworkTransactionResponse (com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse)2 Var (com.google.errorprone.annotations.Var)1 AccountBalanceQuery (com.hedera.hashgraph.sdk.AccountBalanceQuery)1 CustomFee (com.hedera.hashgraph.sdk.CustomFee)1