From 85b6213333b211bbfae9209630d8446108c4ce56 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 8 Apr 2024 19:56:54 +0200 Subject: wallet-core: refactor getTotalRefreshCost --- packages/taler-wallet-core/src/pay-merchant.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'packages/taler-wallet-core/src/pay-merchant.ts') diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts index 5b4db4931..2a01481b0 100644 --- a/packages/taler-wallet-core/src/pay-merchant.ts +++ b/packages/taler-wallet-core/src/pay-merchant.ts @@ -143,7 +143,6 @@ import { getDenomInfo, WalletExecutionContext, } from "./wallet.js"; -import { getCandidateWithdrawalDenomsTx } from "./withdraw.js"; /** * Logger. @@ -468,18 +467,12 @@ export async function getTotalPaymentCost( "can't calculate payment cost, denomination for coin not found", ); } - const allDenoms = await getCandidateWithdrawalDenomsTx( + const amountLeft = Amounts.sub(denom.value, pcs[i].contribution).amount; + const refreshCost = await getTotalRefreshCost( wex, tx, - pcs[i].exchangeBaseUrl, - currency, - ); - const amountLeft = Amounts.sub(denom.value, pcs[i].contribution).amount; - const refreshCost = getTotalRefreshCost( - allDenoms, DenominationRecord.toDenomInfo(denom), amountLeft, - wex.ws.config.testing.denomselAllowLate, ); costs.push(Amounts.parseOrThrow(pcs[i].contribution)); costs.push(refreshCost); -- cgit v1.2.3