use of com.hedera.mirror.common.domain.token.TokenPauseStatusEnum in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerTokenTest method tokenCreate.
void tokenCreate(List<CustomFee> customFees, boolean freezeDefault, boolean freezeKey, boolean kycKey, boolean pauseKey, List<TokenAccount> expectedTokenAccounts, List<EntityId> autoAssociatedAccounts) {
// given
Entity expected = createEntity(DOMAIN_TOKEN_ID, TOKEN_REF_KEY, PAYER.getAccountNum(), AUTO_RENEW_PERIOD, false, EXPIRY_NS, TOKEN_CREATE_MEMO, null, CREATE_TIMESTAMP, CREATE_TIMESTAMP);
// when
createTokenEntity(TOKEN_ID, FUNGIBLE_COMMON, SYMBOL, CREATE_TIMESTAMP, freezeDefault, freezeKey, kycKey, pauseKey, customFees, autoAssociatedAccounts);
// then
assertEquals(1L, entityRepository.count());
assertEntity(expected);
// verify token
TokenPauseStatusEnum pauseStatus = pauseKey ? TokenPauseStatusEnum.UNPAUSED : TokenPauseStatusEnum.NOT_APPLICABLE;
assertTokenInRepository(TOKEN_ID, true, CREATE_TIMESTAMP, CREATE_TIMESTAMP, SYMBOL, INITIAL_SUPPLY, pauseStatus);
assertThat(tokenAccountRepository.findAll()).containsExactlyInAnyOrderElementsOf(expectedTokenAccounts);
assertTokenTransferInRepository(TOKEN_ID, PAYER, CREATE_TIMESTAMP, INITIAL_SUPPLY);
assertCustomFeesInDb(customFees);
assertThat(tokenTransferRepository.count()).isEqualTo(1L);
}
use of com.hedera.mirror.common.domain.token.TokenPauseStatusEnum in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerTokenTest method tokenCreateWithNfts.
@ParameterizedTest(name = "{0}")
@MethodSource("provideTokenCreateNftArguments")
void tokenCreateWithNfts(String name, List<CustomFee> customFees, boolean freezeDefault, boolean freezeKey, boolean kycKey, boolean pauseKey, List<TokenAccount> expectedTokenAccounts) {
// given
Entity expected = createEntity(DOMAIN_TOKEN_ID, TOKEN_REF_KEY, PAYER.getAccountNum(), AUTO_RENEW_PERIOD, false, EXPIRY_NS, TOKEN_CREATE_MEMO, null, CREATE_TIMESTAMP, CREATE_TIMESTAMP);
List<EntityId> autoAssociatedAccounts = expectedTokenAccounts.stream().map(TokenAccount::getId).map(TokenAccountId::getAccountId).collect(Collectors.toList());
// when
createTokenEntity(TOKEN_ID, NON_FUNGIBLE_UNIQUE, SYMBOL, CREATE_TIMESTAMP, freezeDefault, freezeKey, kycKey, pauseKey, customFees, autoAssociatedAccounts);
// then
assertEquals(1L, entityRepository.count());
assertEntity(expected);
// verify token
TokenPauseStatusEnum pauseStatus = pauseKey ? TokenPauseStatusEnum.UNPAUSED : TokenPauseStatusEnum.NOT_APPLICABLE;
assertTokenInRepository(TOKEN_ID, true, CREATE_TIMESTAMP, CREATE_TIMESTAMP, SYMBOL, 0, pauseStatus);
assertThat(tokenAccountRepository.findAll()).containsExactlyInAnyOrderElementsOf(expectedTokenAccounts);
assertCustomFeesInDb(customFees);
assertThat(tokenTransferRepository.count()).isZero();
}
Aggregations