From 1fceb13517106a65c3fb1d7398303e5da0dab77d Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 12 Jan 2023 11:22:37 +0100 Subject: wallet-core: allow zero amounts in payments again --- packages/taler-wallet-core/src/operations/common.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packages/taler-wallet-core/src') diff --git a/packages/taler-wallet-core/src/operations/common.ts b/packages/taler-wallet-core/src/operations/common.ts index 96009eb0b..31c1bebb2 100644 --- a/packages/taler-wallet-core/src/operations/common.ts +++ b/packages/taler-wallet-core/src/operations/common.ts @@ -115,6 +115,12 @@ export async function spendCoins( }>, csi: CoinsSpendInfo, ): Promise { + if (csi.coinPubs.length != csi.contributions.length) { + throw Error("assertion failed"); + } + if (csi.coinPubs.length === 0) { + return; + } let refreshCoinPubs: CoinRefreshRequest[] = []; for (let i = 0; i < csi.coinPubs.length; i++) { const coin = await tx.coins.get(csi.coinPubs[i]); -- cgit v1.2.3