Search in sources :

Example 1 with TokenUnpauseTransactionBody

use of com.hederahashgraph.api.proto.java.TokenUnpauseTransactionBody in project hedera-services by hashgraph.

the class HapiTokenUnpause method opBodyDef.

@Override
protected Consumer<TransactionBody.Builder> opBodyDef(final HapiApiSpec spec) throws Throwable {
    var tId = TxnUtils.asTokenId(token, spec);
    TokenUnpauseTransactionBody opBody = spec.txns().<TokenUnpauseTransactionBody, TokenUnpauseTransactionBody.Builder>body(TokenUnpauseTransactionBody.class, b -> {
        b.setToken(tId);
    });
    return b -> b.setTokenUnpause(opBody);
}
Also used : Transaction(com.hederahashgraph.api.proto.java.Transaction) TokenOpsUsage(com.hedera.services.usage.token.TokenOpsUsage) TOKEN_OPS_USAGE_UTILS(com.hedera.services.usage.token.TokenOpsUsageUtils.TOKEN_OPS_USAGE_UTILS) HapiTxnOp(com.hedera.services.bdd.spec.transactions.HapiTxnOp) FeeData(com.hederahashgraph.api.proto.java.FeeData) MoreObjects(com.google.common.base.MoreObjects) TokenUnpauseTransactionBody(com.hederahashgraph.api.proto.java.TokenUnpauseTransactionBody) Function(java.util.function.Function) Consumer(java.util.function.Consumer) BaseTransactionMeta(com.hedera.services.usage.BaseTransactionMeta) Key(com.hederahashgraph.api.proto.java.Key) List(java.util.List) Logger(org.apache.logging.log4j.Logger) AdapterUtils(com.hedera.services.bdd.spec.fees.AdapterUtils) TxnUtils(com.hedera.services.bdd.spec.transactions.TxnUtils) UsageAccumulator(com.hedera.services.usage.state.UsageAccumulator) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) HederaFunctionality(com.hederahashgraph.api.proto.java.HederaFunctionality) TxnUtils.suFrom(com.hedera.services.bdd.spec.transactions.TxnUtils.suFrom) TransactionResponse(com.hederahashgraph.api.proto.java.TransactionResponse) SigValueObj(com.hederahashgraph.fee.SigValueObj) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) LogManager(org.apache.logging.log4j.LogManager) TokenUnpauseTransactionBody(com.hederahashgraph.api.proto.java.TokenUnpauseTransactionBody)

Example 2 with TokenUnpauseTransactionBody

use of com.hederahashgraph.api.proto.java.TokenUnpauseTransactionBody in project hedera-mirror-node by hashgraph.

the class EntityRecordItemListener method insertTokenUnpause.

private void insertTokenUnpause(RecordItem recordItem) {
    if (entityProperties.getPersist().isTokens()) {
        long consensusTimestamp = recordItem.getConsensusTimestamp();
        TokenUnpauseTransactionBody transactionBody = recordItem.getTransactionBody().getTokenUnpause();
        Token token = Token.of(EntityId.of(transactionBody.getToken()));
        token.setPauseStatus(TokenPauseStatusEnum.UNPAUSED);
        updateToken(token, consensusTimestamp);
    }
}
Also used : TokenUnpauseTransactionBody(com.hederahashgraph.api.proto.java.TokenUnpauseTransactionBody) Token(com.hedera.mirror.common.domain.token.Token)

Aggregations

TokenUnpauseTransactionBody (com.hederahashgraph.api.proto.java.TokenUnpauseTransactionBody)2 MoreObjects (com.google.common.base.MoreObjects)1 Token (com.hedera.mirror.common.domain.token.Token)1 HapiApiSpec (com.hedera.services.bdd.spec.HapiApiSpec)1 AdapterUtils (com.hedera.services.bdd.spec.fees.AdapterUtils)1 HapiTxnOp (com.hedera.services.bdd.spec.transactions.HapiTxnOp)1 TxnUtils (com.hedera.services.bdd.spec.transactions.TxnUtils)1 TxnUtils.suFrom (com.hedera.services.bdd.spec.transactions.TxnUtils.suFrom)1 BaseTransactionMeta (com.hedera.services.usage.BaseTransactionMeta)1 UsageAccumulator (com.hedera.services.usage.state.UsageAccumulator)1 TokenOpsUsage (com.hedera.services.usage.token.TokenOpsUsage)1 TOKEN_OPS_USAGE_UTILS (com.hedera.services.usage.token.TokenOpsUsageUtils.TOKEN_OPS_USAGE_UTILS)1 FeeData (com.hederahashgraph.api.proto.java.FeeData)1 HederaFunctionality (com.hederahashgraph.api.proto.java.HederaFunctionality)1 Key (com.hederahashgraph.api.proto.java.Key)1 Transaction (com.hederahashgraph.api.proto.java.Transaction)1 TransactionBody (com.hederahashgraph.api.proto.java.TransactionBody)1 TransactionResponse (com.hederahashgraph.api.proto.java.TransactionResponse)1 SigValueObj (com.hederahashgraph.fee.SigValueObj)1 List (java.util.List)1