From bafb52edff4d56bcb9e3c3d0a260f507c517b08c Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 16 Dec 2020 17:59:04 +0100 Subject: don't store reserve history anymore, adjust withdrawal implementation accordingly --- packages/taler-wallet-core/src/operations/refresh.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/refresh.ts') diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts index 71cc78fa9..2d80f0a50 100644 --- a/packages/taler-wallet-core/src/operations/refresh.ts +++ b/packages/taler-wallet-core/src/operations/refresh.ts @@ -29,7 +29,7 @@ import { amountToPretty } from "../util/helpers"; import { TransactionHandle } from "../util/query"; import { InternalWalletState, EXCHANGE_COINS_LOCK } from "./state"; import { Logger } from "../util/logging"; -import { getWithdrawDenomList, isWithdrawableDenom } from "./withdraw"; +import { selectWithdrawalDenominations, isWithdrawableDenom } from "./withdraw"; import { updateExchangeFromUrl } from "./exchanges"; import { TalerErrorDetails, @@ -83,7 +83,7 @@ export function getTotalRefreshCost( ): AmountJson { const withdrawAmount = Amounts.sub(amountLeft, refreshedDenom.feeRefresh) .amount; - const withdrawDenoms = getWithdrawDenomList(withdrawAmount, denoms); + const withdrawDenoms = selectWithdrawalDenominations(withdrawAmount, denoms); const resultingAmount = Amounts.add( Amounts.getZero(withdrawAmount.currency), ...withdrawDenoms.selectedDenoms.map( @@ -150,7 +150,7 @@ async function refreshCreateSession( oldDenom.feeRefresh, ).amount; - const newCoinDenoms = getWithdrawDenomList(availableAmount, availableDenoms); + const newCoinDenoms = selectWithdrawalDenominations(availableAmount, availableDenoms); if (newCoinDenoms.selectedDenoms.length === 0) { logger.trace( @@ -478,6 +478,7 @@ async function refreshReveal( oldCoinPub: refreshGroup.oldCoinPubs[coinIndex], }, suspended: false, + coinEvHash: pc.coinEv, }; coins.push(coin); -- cgit v1.2.3