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;
}
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);
}
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());
}
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);
}
Aggregations