From b9e43e652e606706a81f39d4f888477580de79b0 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 8 Sep 2020 19:27:08 +0530 Subject: fix tipping and adjust DB --- packages/taler-wallet-core/src/operations/withdraw.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/withdraw.ts') diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 4070e39f4..eec92ba29 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -242,12 +242,9 @@ async function processPlanchetGenerate( if (!denom) { throw Error("invariant violated"); } - if (withdrawalGroup.source.type != WithdrawalSourceType.Reserve) { - throw Error("invariant violated"); - } const reserve = await ws.db.get( Stores.reserves, - withdrawalGroup.source.reservePub, + withdrawalGroup.reservePub, ); if (!reserve) { throw Error("invariant violated"); @@ -420,7 +417,7 @@ async function processPlanchetVerifyAndStoreCoin( if (!isValid) { await ws.db.runWithWriteTransaction([Stores.planchets], async (tx) => { - let planchet = await ws.db.getIndexed(Stores.planchets.byGroupAndIndex, [ + let planchet = await tx.getIndexed(Stores.planchets.byGroupAndIndex, [ withdrawalGroupId, coinIdx, ]); @@ -700,7 +697,7 @@ async function processWithdrawGroupImpl( if (finishedForFirstTime) { ws.notify({ type: NotificationType.WithdrawGroupFinished, - withdrawalSource: withdrawalGroup.source, + reservePub: withdrawalGroup.reservePub, }); } } -- cgit v1.2.3