[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: comments
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: comments |
Date: |
Wed, 25 Dec 2019 21:48:02 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 7523dcab comments
7523dcab is described below
commit 7523dcab95f6b5fe0c0f3f8f6b9bede67297bc8a
Author: Florian Dold <address@hidden>
AuthorDate: Wed Dec 25 21:47:57 2019 +0100
comments
---
src/operations/pay.ts | 35 ++++++++++++++++++++++++++++++-----
1 file changed, 30 insertions(+), 5 deletions(-)
diff --git a/src/operations/pay.ts b/src/operations/pay.ts
index 8fed54aa..43bdb2f4 100644
--- a/src/operations/pay.ts
+++ b/src/operations/pay.ts
@@ -1,6 +1,6 @@
/*
This file is part of GNU Taler
- (C) Taler Systems S.A.
+ (C) 2019 Taler Systems S.A.
GNU Taler is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -62,6 +62,11 @@ import { InternalWalletState } from "./state";
import { getTimestampNow, timestampAddDuration } from "../util/time";
import { strcmp, canonicalJson } from "../util/helpers";
+/**
+ * Logger.
+ */
+const logger = new Logger("pay.ts");
+
/**
* Result of selecting coins, contains the exchange, and selected
* coins with their denomination.
@@ -93,17 +98,39 @@ export interface PayCoinSelection {
customerDepositFees: AmountJson;
}
+/**
+ * Structure to describe a coin that is available to be
+ * used in a payment.
+ */
export interface AvailableCoinInfo {
+ /**
+ * Public key of the coin.
+ */
coinPub: string;
+
+ /**
+ * Coin's denomination public key.
+ */
denomPub: string;
+
+ /**
+ * Amount still remaining (typically the full amount,
+ * as coins are always refreshed after use.)
+ */
availableAmount: AmountJson;
+
+ /**
+ * Deposit fee for the coin.
+ */
feeDeposit: AmountJson;
}
-const logger = new Logger("pay.ts");
-
/**
* Compute the total cost of a payment to the customer.
+ *
+ * This includes the amount taken by the merchant, fees (wire/deposit)
contributed
+ * by the customer, refreshing fees, fees for withdraw-after-refresh and
"trimmings"
+ * of coins that are too small to spend.
*/
export async function getTotalPaymentCost(
ws: InternalWalletState,
@@ -147,8 +174,6 @@ export async function getTotalPaymentCost(
* constraints.
*
* This function is only exported for the sake of unit tests.
- *
- * @param denoms all available denoms, used to compute refresh fees
*/
export function selectPayCoins(
acis: AvailableCoinInfo[],
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: comments,
gnunet <=