From e56d3ba8ebc29c41e95505f3d3cdd6de62e7ce34 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 21 Feb 2023 01:15:27 +0100 Subject: taler-wallet-cli: make purse expiration configurable --- packages/taler-wallet-core/src/operations/pay-peer.ts | 6 +++++- packages/taler-wallet-core/src/operations/withdraw.ts | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-core') diff --git a/packages/taler-wallet-core/src/operations/pay-peer.ts b/packages/taler-wallet-core/src/operations/pay-peer.ts index 4dcc06076..5178839a4 100644 --- a/packages/taler-wallet-core/src/operations/pay-peer.ts +++ b/packages/taler-wallet-core/src/operations/pay-peer.ts @@ -97,7 +97,6 @@ import { runLongpollAsync, runOperationWithErrorReporting, spendCoins, - storeOperationPending, } from "../operations/common.js"; import { readSuccessResponseJsonOrErrorCode, @@ -220,6 +219,11 @@ export async function selectPeerCoins( ws: InternalWalletState, instructedAmount: AmountJson, ): Promise { + if (Amounts.isZero(instructedAmount)) { + // Other parts of the code assume that we have at least + // one coin to spend. + throw new Error("amount of zero not allowed"); + } return await ws.db .mktx((x) => [ x.exchanges, diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index aba2948cd..3c3878792 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -118,8 +118,6 @@ import { } from "../versions.js"; import { makeTransactionId, - storeOperationError, - storeOperationPending, } from "./common.js"; import { getExchangeDetails, -- cgit v1.2.3