Search in sources :

Example 1 with MirrorTokenResponse

use of com.hedera.mirror.test.e2e.acceptance.response.MirrorTokenResponse in project hedera-mirror-node by hashgraph.

the class TokenFeature method verifyToken.

private MirrorTokenResponse verifyToken(TokenId tokenId) {
    MirrorTokenResponse mirrorToken = mirrorClient.getTokenInfo(tokenId.toString());
    assertNotNull(mirrorToken);
    assertThat(mirrorToken.getTokenId()).isEqualTo(tokenId.toString());
    return mirrorToken;
}
Also used : MirrorTokenResponse(com.hedera.mirror.test.e2e.acceptance.response.MirrorTokenResponse)

Example 2 with MirrorTokenResponse

use of com.hedera.mirror.test.e2e.acceptance.response.MirrorTokenResponse in project hedera-mirror-node by hashgraph.

the class TokenFeature method verifyTokenPauseStatus.

private void verifyTokenPauseStatus(TokenId tokenId, String pauseStatus) {
    MirrorTokenResponse mirrorToken = verifyToken(tokenId);
    assertThat(mirrorToken.getPauseStatus()).isEqualTo(pauseStatus);
}
Also used : MirrorTokenResponse(com.hedera.mirror.test.e2e.acceptance.response.MirrorTokenResponse)

Example 3 with MirrorTokenResponse

use of com.hedera.mirror.test.e2e.acceptance.response.MirrorTokenResponse in project hedera-mirror-node by hashgraph.

the class TokenFeature method verifyTokenUpdate.

private void verifyTokenUpdate(TokenId tokenId) {
    MirrorTokenResponse mirrorToken = verifyToken(tokenId);
    assertThat(mirrorToken.getCreatedTimestamp()).isNotEqualTo(mirrorToken.getModifiedTimestamp());
}
Also used : MirrorTokenResponse(com.hedera.mirror.test.e2e.acceptance.response.MirrorTokenResponse)

Example 4 with MirrorTokenResponse

use of com.hedera.mirror.test.e2e.acceptance.response.MirrorTokenResponse in project hedera-mirror-node by hashgraph.

the class TokenFeature method verifyTokenWithCustomFeesSchedule.

private void verifyTokenWithCustomFeesSchedule(TokenId tokenId, String createdTimestamp) {
    MirrorTokenResponse response = verifyToken(tokenId);
    MirrorCustomFees expected = new MirrorCustomFees();
    expected.setCreatedTimestamp(createdTimestamp);
    for (CustomFee customFee : tokenCustomFees.get(tokenId)) {
        if (customFee instanceof CustomFixedFee) {
            CustomFixedFee sdkFixedFee = (CustomFixedFee) customFee;
            MirrorFixedFee fixedFee = new MirrorFixedFee();
            fixedFee.setAmount(sdkFixedFee.getAmount());
            fixedFee.setCollectorAccountId(sdkFixedFee.getFeeCollectorAccountId().toString());
            if (sdkFixedFee.getDenominatingTokenId() != null) {
                fixedFee.setDenominatingTokenId(sdkFixedFee.getDenominatingTokenId().toString());
            }
            expected.getFixedFees().add(fixedFee);
        } else {
            CustomFractionalFee sdkFractionalFee = (CustomFractionalFee) customFee;
            MirrorFractionalFee fractionalFee = new MirrorFractionalFee();
            MirrorFraction fraction = new MirrorFraction();
            fraction.setNumerator(sdkFractionalFee.getNumerator());
            fraction.setDenominator(sdkFractionalFee.getDenominator());
            fractionalFee.setAmount(fraction);
            fractionalFee.setCollectorAccountId(sdkFractionalFee.getFeeCollectorAccountId().toString());
            fractionalFee.setDenominatingTokenId(tokenId.toString());
            if (sdkFractionalFee.getMax() != 0) {
                fractionalFee.setMaximum(sdkFractionalFee.getMax());
            }
            fractionalFee.setMinimum(sdkFractionalFee.getMin());
            expected.getFractionalFees().add(fractionalFee);
        }
    }
    MirrorCustomFees actual = response.getCustomFees();
    assertThat(actual).usingRecursiveComparison(RecursiveComparisonConfiguration.builder().withIgnoreCollectionOrder(true).build()).isEqualTo(expected);
}
Also used : MirrorCustomFees(com.hedera.mirror.test.e2e.acceptance.props.MirrorCustomFees) MirrorFraction(com.hedera.mirror.test.e2e.acceptance.props.MirrorFraction) CustomFractionalFee(com.hedera.hashgraph.sdk.CustomFractionalFee) CustomFee(com.hedera.hashgraph.sdk.CustomFee) MirrorAssessedCustomFee(com.hedera.mirror.test.e2e.acceptance.props.MirrorAssessedCustomFee) CustomFixedFee(com.hedera.hashgraph.sdk.CustomFixedFee) MirrorFractionalFee(com.hedera.mirror.test.e2e.acceptance.props.MirrorFractionalFee) MirrorFixedFee(com.hedera.mirror.test.e2e.acceptance.props.MirrorFixedFee) MirrorTokenResponse(com.hedera.mirror.test.e2e.acceptance.response.MirrorTokenResponse)

Aggregations

MirrorTokenResponse (com.hedera.mirror.test.e2e.acceptance.response.MirrorTokenResponse)4 CustomFee (com.hedera.hashgraph.sdk.CustomFee)1 CustomFixedFee (com.hedera.hashgraph.sdk.CustomFixedFee)1 CustomFractionalFee (com.hedera.hashgraph.sdk.CustomFractionalFee)1 MirrorAssessedCustomFee (com.hedera.mirror.test.e2e.acceptance.props.MirrorAssessedCustomFee)1 MirrorCustomFees (com.hedera.mirror.test.e2e.acceptance.props.MirrorCustomFees)1 MirrorFixedFee (com.hedera.mirror.test.e2e.acceptance.props.MirrorFixedFee)1 MirrorFraction (com.hedera.mirror.test.e2e.acceptance.props.MirrorFraction)1 MirrorFractionalFee (com.hedera.mirror.test.e2e.acceptance.props.MirrorFractionalFee)1