use of com.hederahashgraph.api.proto.java.TokenRevokeKycTransactionBody in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListener method insertTokenAccountRevokeKyc.
private void insertTokenAccountRevokeKyc(RecordItem recordItem) {
if (entityProperties.getPersist().isTokens()) {
TokenRevokeKycTransactionBody tokenRevokeKycTransactionBody = recordItem.getTransactionBody().getTokenRevokeKyc();
EntityId tokenId = EntityId.of(tokenRevokeKycTransactionBody.getToken());
EntityId accountId = EntityId.of(tokenRevokeKycTransactionBody.getAccount());
TokenAccount tokenAccount = new TokenAccount(tokenId, accountId, recordItem.getConsensusTimestamp());
tokenAccount.setKycStatus(TokenKycStatusEnum.REVOKED);
entityListener.onTokenAccount(tokenAccount);
}
}
use of com.hederahashgraph.api.proto.java.TokenRevokeKycTransactionBody in project hedera-services by hashgraph.
the class HapiTokenKycRevoke method opBodyDef.
@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
var aId = TxnUtils.asId(account, spec);
var tId = TxnUtils.asTokenId(token, spec);
TokenRevokeKycTransactionBody opBody = spec.txns().<TokenRevokeKycTransactionBody, TokenRevokeKycTransactionBody.Builder>body(TokenRevokeKycTransactionBody.class, b -> {
b.setAccount(aId);
b.setToken(tId);
});
return b -> b.setTokenRevokeKyc(opBody);
}
Aggregations