Search in sources :

Example 1 with TokenFeeScheduleUpdate

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

the class HapiTokenFeeScheduleUpdate method feeFor.

@Override
protected long feeFor(HapiApiSpec spec, Transaction txn, int numPayerKeys) throws Throwable {
    try {
        final TokenInfo info = lookupInfo(spec, token, log, loggingOff);
        final FeeCalculator.ActivityMetrics metricsCalc = (_txn, svo) -> usageEstimate(_txn, svo, info);
        return spec.fees().forActivityBasedOp(TokenFeeScheduleUpdate, metricsCalc, txn, numPayerKeys);
    } catch (Throwable ignore) {
        return HapiApiSuite.ONE_HBAR;
    }
}
Also used : FeeScheduleUpdateMeta(com.hedera.services.usage.token.meta.FeeScheduleUpdateMeta) Transaction(com.hederahashgraph.api.proto.java.Transaction) TokenFeeScheduleUpdate(com.hederahashgraph.api.proto.java.HederaFunctionality.TokenFeeScheduleUpdate) HapiTxnOp(com.hedera.services.bdd.spec.transactions.HapiTxnOp) QueryVerbs.getTokenInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getTokenInfo) ExtantFeeScheduleContext(com.hedera.services.usage.token.meta.ExtantFeeScheduleContext) Function(java.util.function.Function) HapiGetTokenInfo(com.hedera.services.bdd.spec.queries.token.HapiGetTokenInfo) TokenInfo(com.hederahashgraph.api.proto.java.TokenInfo) ArrayList(java.util.ArrayList) BaseTransactionMeta(com.hedera.services.usage.BaseTransactionMeta) TxnUtils(com.hedera.services.bdd.spec.transactions.TxnUtils) UsageAccumulator(com.hedera.services.usage.state.UsageAccumulator) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) TransactionResponse(com.hederahashgraph.api.proto.java.TransactionResponse) SigValueObj(com.hederahashgraph.fee.SigValueObj) CustomFee(com.hederahashgraph.api.proto.java.CustomFee) TokenOpsUsage(com.hedera.services.usage.token.TokenOpsUsage) FeeData(com.hederahashgraph.api.proto.java.FeeData) MoreObjects(com.google.common.base.MoreObjects) HapiPropertySource(com.hedera.services.bdd.spec.HapiPropertySource) Consumer(java.util.function.Consumer) 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) TokenFeeScheduleUpdateTransactionBody(com.hederahashgraph.api.proto.java.TokenFeeScheduleUpdateTransactionBody) HederaFunctionality(com.hederahashgraph.api.proto.java.HederaFunctionality) Optional(java.util.Optional) TxnUtils.suFrom(com.hedera.services.bdd.spec.transactions.TxnUtils.suFrom) FeeCalculator(com.hedera.services.bdd.spec.fees.FeeCalculator) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) LogManager(org.apache.logging.log4j.LogManager) FeeCalculator(com.hedera.services.bdd.spec.fees.FeeCalculator) QueryVerbs.getTokenInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getTokenInfo) HapiGetTokenInfo(com.hedera.services.bdd.spec.queries.token.HapiGetTokenInfo) TokenInfo(com.hederahashgraph.api.proto.java.TokenInfo)

Aggregations

MoreObjects (com.google.common.base.MoreObjects)1 HapiApiSpec (com.hedera.services.bdd.spec.HapiApiSpec)1 HapiPropertySource (com.hedera.services.bdd.spec.HapiPropertySource)1 AdapterUtils (com.hedera.services.bdd.spec.fees.AdapterUtils)1 FeeCalculator (com.hedera.services.bdd.spec.fees.FeeCalculator)1 QueryVerbs.getTokenInfo (com.hedera.services.bdd.spec.queries.QueryVerbs.getTokenInfo)1 HapiGetTokenInfo (com.hedera.services.bdd.spec.queries.token.HapiGetTokenInfo)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 HapiApiSuite (com.hedera.services.bdd.suites.HapiApiSuite)1 BaseTransactionMeta (com.hedera.services.usage.BaseTransactionMeta)1 UsageAccumulator (com.hedera.services.usage.state.UsageAccumulator)1 TokenOpsUsage (com.hedera.services.usage.token.TokenOpsUsage)1 ExtantFeeScheduleContext (com.hedera.services.usage.token.meta.ExtantFeeScheduleContext)1 FeeScheduleUpdateMeta (com.hedera.services.usage.token.meta.FeeScheduleUpdateMeta)1 CustomFee (com.hederahashgraph.api.proto.java.CustomFee)1 FeeData (com.hederahashgraph.api.proto.java.FeeData)1 HederaFunctionality (com.hederahashgraph.api.proto.java.HederaFunctionality)1 TokenFeeScheduleUpdate (com.hederahashgraph.api.proto.java.HederaFunctionality.TokenFeeScheduleUpdate)1