aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-09-21 12:40:02 +0200
committerFlorian Dold <florian@dold.me>2022-09-21 12:40:11 +0200
commit28b4489bead6cd88db1b91e0e0ae8b8e0d1d0007 (patch)
tree2ffbe9d0b63aef8cc91cba28f4c65dd1b5a94a02 /packages/taler-wallet-core/src/wallet.ts
parent859991a40c4a7757d874f9ae6e6db7b76145a3c3 (diff)
downloadwallet-core-28b4489bead6cd88db1b91e0e0ae8b8e0d1d0007.tar.xz
wallet-core: make basic backup work again
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index 2e362da6e..c91a96841 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -221,7 +221,7 @@ import {
HttpRequestLibrary,
readSuccessResponseJsonOrThrow,
} from "./util/http.js";
-import { checkDbInvariant } from "./util/invariants.js";
+import { checkDbInvariant, checkLogicInvariant } from "./util/invariants.js";
import {
AsyncCondition,
OpenedPromise,
@@ -812,6 +812,7 @@ export async function makeCoinAvailable(
}>,
coinRecord: CoinRecord,
): Promise<void> {
+ checkLogicInvariant(coinRecord.status === CoinStatus.Fresh);
const existingCoin = await tx.coins.get(coinRecord.coinPub);
if (existingCoin) {
return;