use of com.hedera.services.usage.BaseTransactionMeta in project hedera-services by hashgraph.
the class HapiTokenMint method usageEstimate.
private FeeData usageEstimate(TransactionBody txn, SigValueObj svo) throws Throwable {
UsageAccumulator accumulator = new UsageAccumulator();
long lifetime = 0L;
if (subType == SubType.TOKEN_NON_FUNGIBLE_UNIQUE) {
lifetime = info.getExpiry().getSeconds() - txn.getTransactionID().getTransactionValidStart().getSeconds();
}
final var tokenBurnMeta = TOKEN_OPS_USAGE_UTILS.tokenMintUsageFrom(txn, subType, lifetime);
final var baseTransactionMeta = new BaseTransactionMeta(txn.getMemoBytes().size(), 0);
TokenOpsUsage tokenOpsUsage = new TokenOpsUsage();
tokenOpsUsage.tokenMintUsage(suFrom(svo), baseTransactionMeta, tokenBurnMeta, accumulator);
return AdapterUtils.feeDataFrom(accumulator);
}
use of com.hedera.services.usage.BaseTransactionMeta in project hedera-services by hashgraph.
the class HapiTokenPause method usageEstimate.
private FeeData usageEstimate(TransactionBody txn, SigValueObj svo) {
UsageAccumulator accumulator = new UsageAccumulator();
final var tokenPauseMeta = TOKEN_OPS_USAGE_UTILS.tokenPauseUsageFrom();
final var baseTransactionMeta = new BaseTransactionMeta(txn.getMemoBytes().size(), 0);
TokenOpsUsage tokenOpsUsage = new TokenOpsUsage();
tokenOpsUsage.tokenPauseUsage(suFrom(svo), baseTransactionMeta, tokenPauseMeta, accumulator);
return AdapterUtils.feeDataFrom(accumulator);
}
use of com.hedera.services.usage.BaseTransactionMeta in project hedera-services by hashgraph.
the class HapiTokenUnfreeze method usageEstimate.
private FeeData usageEstimate(TransactionBody txn, SigValueObj svo) {
UsageAccumulator accumulator = new UsageAccumulator();
final var tokenUnfreezeMeta = TOKEN_OPS_USAGE_UTILS.tokenUnfreezeUsageFrom();
final var baseTransactionMeta = new BaseTransactionMeta(txn.getMemoBytes().size(), 0);
TokenOpsUsage tokenOpsUsage = new TokenOpsUsage();
tokenOpsUsage.tokenUnfreezeUsage(suFrom(svo), baseTransactionMeta, tokenUnfreezeMeta, accumulator);
return AdapterUtils.feeDataFrom(accumulator);
}
use of com.hedera.services.usage.BaseTransactionMeta in project hedera-services by hashgraph.
the class HapiTokenUnpause method usageEstimate.
private FeeData usageEstimate(TransactionBody txn, SigValueObj svo) {
UsageAccumulator accumulator = new UsageAccumulator();
final var tokenUnpauseMeta = TOKEN_OPS_USAGE_UTILS.tokenUnpauseUsageFrom();
final var baseTransactionMeta = new BaseTransactionMeta(txn.getMemoBytes().size(), 0);
TokenOpsUsage tokenOpsUsage = new TokenOpsUsage();
tokenOpsUsage.tokenUnpauseUsage(suFrom(svo), baseTransactionMeta, tokenUnpauseMeta, accumulator);
return AdapterUtils.feeDataFrom(accumulator);
}
Aggregations