wallet-core: allow zero amounts in payments again

This commit is contained in:
Florian Dold 2023-01-12 11:22:37 +01:00
parent e87073d42a
commit 1fceb13517
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 8 additions and 0 deletions

View File

@ -115,6 +115,12 @@ export async function spendCoins(
}>,
csi: CoinsSpendInfo,
): Promise<void> {
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]);

View File

@ -21,6 +21,7 @@
import {
AbsoluteTime,
ExtendedStatus,
PaymentStatus,
TalerProtocolTimestamp,
TransactionCommon,
@ -60,6 +61,7 @@ export default {
const commonTransaction = {
amountRaw: "KUDOS:11",
amountEffective: "KUDOS:9.2",
extendedStatus: ExtendedStatus.Done,
pending: false,
timestamp: TalerProtocolTimestamp.now(),
transactionId: "txn:deposit:12",