From aae06c680f7d31d0a2f2a2059b57a8d7c575d3c7 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 8 Sep 2020 21:03:10 +0530 Subject: DB tweaks --- packages/taler-wallet-core/src/operations/tip.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/tip.ts') diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts index 7b914568f..08f45eb89 100644 --- a/packages/taler-wallet-core/src/operations/tip.ts +++ b/packages/taler-wallet-core/src/operations/tip.ts @@ -104,10 +104,11 @@ export async function prepareTip( planchets: undefined, createdTimestamp: getTimestampNow(), merchantTipId: res.merchantTipId, - tipAmountEffective: Amounts.sub(amount, Amounts.add( - withdrawDetails.overhead, - withdrawDetails.withdrawFee, - ).amount).amount, + tipAmountEffective: Amounts.sub( + amount, + Amounts.add(withdrawDetails.overhead, withdrawDetails.withdrawFee) + .amount, + ).amount, retryInfo: initRetryInfo(), lastError: undefined, denomsSel: denomSelectionInfoToState(selectedDenoms), @@ -200,10 +201,10 @@ async function processTipImpl( const planchets: TipPlanchet[] = []; for (const sd of denomsForWithdraw.selectedDenoms) { - const denom = await ws.db.getIndexed( - Stores.denominations.denomPubHashIndex, + const denom = await ws.db.get(Stores.denominations, [ + tipRecord.exchangeBaseUrl, sd.denomPubHash, - ); + ]); if (!denom) { throw Error("denom does not exist anymore"); } -- cgit v1.2.3