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