Search in sources :

Example 1 with PricedUsageCalculator

use of com.hedera.services.fees.calculation.utils.PricedUsageCalculator in project hedera-services by hashgraph.

the class UsageBasedFeeCalculatorTest method setup.

@BeforeEach
private void setup() throws Throwable {
    view = mock(StateView.class);
    query = mock(Query.class);
    payerKey = complexKey.asJKey();
    exchange = mock(HbarCentExchange.class);
    signedTxn = newSignedCryptoCreate().balance(balance).payerKt(complexKey).txnValidStart(at).get();
    accessor = new SignedTxnAccessor(signedTxn);
    usagePrices = mock(UsagePricesProvider.class);
    given(usagePrices.activePrices(accessor)).willReturn(currentPrices);
    correctOpEstimator = mock(TxnResourceUsageEstimator.class);
    incorrectOpEstimator = mock(TxnResourceUsageEstimator.class);
    correctQueryEstimator = mock(QueryResourceUsageEstimator.class);
    incorrectQueryEstimator = mock(QueryResourceUsageEstimator.class);
    autoRenewCalcs = mock(AutoRenewCalcs.class);
    pricedUsageCalculator = mock(PricedUsageCalculator.class);
    txnUsageEstimators = (Map<HederaFunctionality, List<TxnResourceUsageEstimator>>) mock(Map.class);
    subject = new UsageBasedFeeCalculator(autoRenewCalcs, exchange, mock(AutoCreationLogic.class), usagePrices, new NestedMultiplierSource(), pricedUsageCalculator, Set.of(incorrectQueryEstimator, correctQueryEstimator), txnUsageEstimators);
}
Also used : HederaFunctionality(com.hederahashgraph.api.proto.java.HederaFunctionality) Query(com.hederahashgraph.api.proto.java.Query) StateView(com.hedera.services.context.primitives.StateView) SignedTxnAccessor(com.hedera.services.utils.SignedTxnAccessor) HbarCentExchange(com.hedera.services.fees.HbarCentExchange) List(java.util.List) PricedUsageCalculator(com.hedera.services.fees.calculation.utils.PricedUsageCalculator) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

StateView (com.hedera.services.context.primitives.StateView)1 HbarCentExchange (com.hedera.services.fees.HbarCentExchange)1 PricedUsageCalculator (com.hedera.services.fees.calculation.utils.PricedUsageCalculator)1 SignedTxnAccessor (com.hedera.services.utils.SignedTxnAccessor)1 HederaFunctionality (com.hederahashgraph.api.proto.java.HederaFunctionality)1 Query (com.hederahashgraph.api.proto.java.Query)1 List (java.util.List)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1