[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 02/02: wallet: use correct denoms as refresh targets
From: |
gnunet |
Subject: |
[taler-wallet-core] 02/02: wallet: use correct denoms as refresh targets |
Date: |
Wed, 01 Dec 2021 18:08:00 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
commit 9f60e3d7ec989f7f0a3db13af8a902f237c77559
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Dec 1 18:07:55 2021 +0100
wallet: use correct denoms as refresh targets
---
packages/taler-wallet-core/src/operations/pay.ts | 6 ++++--
packages/taler-wallet-core/src/operations/withdraw.ts | 7 ++++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/packages/taler-wallet-core/src/operations/pay.ts
b/packages/taler-wallet-core/src/operations/pay.ts
index 73fc6537..5aa23496 100644
--- a/packages/taler-wallet-core/src/operations/pay.ts
+++ b/packages/taler-wallet-core/src/operations/pay.ts
@@ -162,8 +162,10 @@ export async function getTotalPaymentCost(
);
}
const allDenoms = await tx.denominations.indexes.byExchangeBaseUrl
- .iter()
- .toArray();
+ .iter(coin.exchangeBaseUrl)
+ .filter((x) =>
+ Amounts.isSameCurrency(x.value, pcs.coinContributions[i]),
+ );
const amountLeft = Amounts.sub(denom.value, pcs.coinContributions[i])
.amount;
const refreshCost = getTotalRefreshCost(allDenoms, denom, amountLeft);
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts
b/packages/taler-wallet-core/src/operations/withdraw.ts
index 8c9178f5..ebab5468 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -219,7 +219,7 @@ export function selectWithdrawalDenominations(
for (const d of denoms) {
let count = 0;
const cost = Amounts.add(d.value, d.feeWithdraw).amount;
- for (; ;) {
+ for (;;) {
if (Amounts.cmp(remaining, cost) < 0) {
break;
}
@@ -773,7 +773,8 @@ export async function updateWithdrawalDenoms(
denom.verificationStatus === DenominationVerificationStatus.Unverified
) {
logger.trace(
- `Validating denomination (${current + 1}/${denominations.length
+ `Validating denomination (${current + 1}/${
+ denominations.length
}) signature of ${denom.denomPubHash}`,
);
const valid = await ws.cryptoApi.isValidDenom(
@@ -1023,7 +1024,7 @@ export async function getExchangeWithdrawalInfo(
) {
console.warn(
`wallet's support for exchange protocol version
${WALLET_EXCHANGE_PROTOCOL_VERSION} might be outdated ` +
- `(exchange has ${exchangeDetails.protocolVersion}), checking for
updates`,
+ `(exchange has ${exchangeDetails.protocolVersion}), checking for
updates`,
);
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.