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);
}
Aggregations