wallet-core: allow zero amounts in payments again
This commit is contained in:
parent
e87073d42a
commit
1fceb13517
@ -115,6 +115,12 @@ export async function spendCoins(
|
|||||||
}>,
|
}>,
|
||||||
csi: CoinsSpendInfo,
|
csi: CoinsSpendInfo,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
if (csi.coinPubs.length != csi.contributions.length) {
|
||||||
|
throw Error("assertion failed");
|
||||||
|
}
|
||||||
|
if (csi.coinPubs.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let refreshCoinPubs: CoinRefreshRequest[] = [];
|
let refreshCoinPubs: CoinRefreshRequest[] = [];
|
||||||
for (let i = 0; i < csi.coinPubs.length; i++) {
|
for (let i = 0; i < csi.coinPubs.length; i++) {
|
||||||
const coin = await tx.coins.get(csi.coinPubs[i]);
|
const coin = await tx.coins.get(csi.coinPubs[i]);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
AbsoluteTime,
|
AbsoluteTime,
|
||||||
|
ExtendedStatus,
|
||||||
PaymentStatus,
|
PaymentStatus,
|
||||||
TalerProtocolTimestamp,
|
TalerProtocolTimestamp,
|
||||||
TransactionCommon,
|
TransactionCommon,
|
||||||
@ -60,6 +61,7 @@ export default {
|
|||||||
const commonTransaction = {
|
const commonTransaction = {
|
||||||
amountRaw: "KUDOS:11",
|
amountRaw: "KUDOS:11",
|
||||||
amountEffective: "KUDOS:9.2",
|
amountEffective: "KUDOS:9.2",
|
||||||
|
extendedStatus: ExtendedStatus.Done,
|
||||||
pending: false,
|
pending: false,
|
||||||
timestamp: TalerProtocolTimestamp.now(),
|
timestamp: TalerProtocolTimestamp.now(),
|
||||||
transactionId: "txn:deposit:12",
|
transactionId: "txn:deposit:12",
|
||||||
|
Loading…
Reference in New Issue
Block a user