use of com.hederahashgraph.api.proto.java.TokenUnfreezeAccountTransactionBody in project hedera-services by hashgraph.
the class HapiTokenUnfreeze method opBodyDef.
@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
var aId = TxnUtils.asId(account, spec);
var tId = TxnUtils.asTokenId(token, spec);
TokenUnfreezeAccountTransactionBody opBody = spec.txns().<TokenUnfreezeAccountTransactionBody, TokenUnfreezeAccountTransactionBody.Builder>body(TokenUnfreezeAccountTransactionBody.class, b -> {
b.setAccount(aId);
b.setToken(tId);
});
return b -> b.setTokenUnfreeze(opBody);
}
use of com.hederahashgraph.api.proto.java.TokenUnfreezeAccountTransactionBody in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListener method insertTokenAccountUnfreeze.
private void insertTokenAccountUnfreeze(RecordItem recordItem) {
if (entityProperties.getPersist().isTokens()) {
TokenUnfreezeAccountTransactionBody tokenUnfreezeAccountTransactionBody = recordItem.getTransactionBody().getTokenUnfreeze();
EntityId tokenId = EntityId.of(tokenUnfreezeAccountTransactionBody.getToken());
EntityId accountId = EntityId.of(tokenUnfreezeAccountTransactionBody.getAccount());
long consensusTimestamp = recordItem.getConsensusTimestamp();
TokenAccount tokenAccount = new TokenAccount(tokenId, accountId, consensusTimestamp);
tokenAccount.setFreezeStatus(TokenFreezeStatusEnum.UNFROZEN);
entityListener.onTokenAccount(tokenAccount);
}
}
Aggregations