summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-02-21 01:15:27 +0100
committerFlorian Dold <florian@dold.me>2023-02-21 01:15:27 +0100
commite56d3ba8ebc29c41e95505f3d3cdd6de62e7ce34 (patch)
treef178d8d0b0994ec21a9d14a58ed5be49da571cb3 /packages/taler-wallet-core/src/operations
parentb9b1dd73f58c3ee66161fd316299c0a6772b0a0d (diff)
downloadwallet-core-e56d3ba8ebc29c41e95505f3d3cdd6de62e7ce34.tar.gz
wallet-core-e56d3ba8ebc29c41e95505f3d3cdd6de62e7ce34.tar.bz2
wallet-core-e56d3ba8ebc29c41e95505f3d3cdd6de62e7ce34.zip
taler-wallet-cli: make purse expiration configurable
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/pay-peer.ts6
-rw-r--r--packages/taler-wallet-core/src/operations/withdraw.ts2
2 files changed, 5 insertions, 3 deletions
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<SelectPeerCoinsResult> {
+ 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,