From 92f1b5928c764b3af12a29b97bbc3e434a82b1b0 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 5 Jan 2023 18:45:49 +0100 Subject: wallet-core: implement insufficient balance details For now, only for merchant payments --- packages/taler-wallet-core/src/wallet.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages/taler-wallet-core/src/wallet.ts') diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 1defff0d2..e15c6110c 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -1178,6 +1178,9 @@ async function dispatchRequestInternal( } case WalletApiOperation.ForceRefresh: { const req = codecForForceRefreshRequest().decode(payload); + if (req.coinPubList.length == 0) { + throw Error("refusing to create empty refresh group"); + } const refreshGroupId = await ws.db .mktx((x) => [ x.refreshGroups, @@ -1207,6 +1210,7 @@ async function dispatchRequestInternal( return await createRefreshGroup( ws, tx, + Amounts.currencyOf(coinPubs[0].amount), coinPubs, RefreshReason.Manual, ); -- cgit v1.2.3