aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/withdraw.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-09-08 19:27:08 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-09-08 19:27:08 +0530
commitb9e43e652e606706a81f39d4f888477580de79b0 (patch)
treed6840162173a9c97414c3662a7ad43bf7349f1d6 /packages/taler-wallet-core/src/operations/withdraw.ts
parentb063382d25d1ed8572ebe2f52bf54247379300d5 (diff)
downloadwallet-core-b9e43e652e606706a81f39d4f888477580de79b0.tar.xz
fix tipping and adjust DB
Diffstat (limited to 'packages/taler-wallet-core/src/operations/withdraw.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/withdraw.ts9
1 files changed, 3 insertions, 6 deletions
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,
});
}
}