summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/tip.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2020-12-17 12:21:03 +0100
committerFlorian Dold <florian@dold.me>2020-12-17 12:21:03 +0100
commit84d5b5e5ef34f7289256c6fd301206cda19be694 (patch)
tree5db646c7fb1b782b42150a38c6d4f1e6bdfea55f /packages/taler-wallet-core/src/operations/tip.ts
parentbafb52edff4d56bcb9e3c3d0a260f507c517b08c (diff)
downloadwallet-core-84d5b5e5ef34f7289256c6fd301206cda19be694.tar.gz
wallet-core-84d5b5e5ef34f7289256c6fd301206cda19be694.tar.bz2
wallet-core-84d5b5e5ef34f7289256c6fd301206cda19be694.zip
export complete backup, derive planchets in withdrawal
Diffstat (limited to 'packages/taler-wallet-core/src/operations/tip.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/tip.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts
index f47f76623..f683999bc 100644
--- a/packages/taler-wallet-core/src/operations/tip.ts
+++ b/packages/taler-wallet-core/src/operations/tip.ts
@@ -48,7 +48,7 @@ import {
} from "../util/http";
import { URL } from "../util/url";
import { Logger } from "../util/logging";
-import { checkDbInvariant } from "../util/invariants";
+import { checkDbInvariant, checkLogicInvariant } from "../util/invariants";
import { TalerErrorCode } from "../TalerErrorCode";
import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries";
import { j2s } from "../util/helpers";
@@ -221,13 +221,13 @@ async function processTipImpl(
dh.denomPubHash,
]);
checkDbInvariant(!!denom, "denomination should be in database");
- denomForPlanchet[planchets.length] = denom;
for (let i = 0; i < dh.count; i++) {
const p = await ws.cryptoApi.createTipPlanchet({
- denomPub: dh.denomPubHash,
+ denomPub: denom.denomPub,
planchetIndex: planchets.length,
secretSeed: tipRecord.secretSeed,
});
+ denomForPlanchet[planchets.length] = denom;
planchets.push(p);
planchetsDetail.push({
coin_ev: p.coinEv,
@@ -275,7 +275,9 @@ async function processTipImpl(
const blindedSig = response.blind_sigs[i].blind_sig;
const denom = denomForPlanchet[i];
+ checkLogicInvariant(!!denom);
const planchet = planchets[i];
+ checkLogicInvariant(!!planchet);
const denomSig = await ws.cryptoApi.rsaUnblind(
blindedSig,