[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: wallet-core: add wire method
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: wallet-core: add wire method check in new coin selection |
Date: |
Mon, 19 Sep 2022 11:28:55 +0200 |
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 cffc4347a wallet-core: add wire method check in new coin selection
cffc4347a is described below
commit cffc4347a0b3a7b6024b4d274e7225f49f75eb08
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Sep 19 11:28:47 2022 +0200
wallet-core: add wire method check in new coin selection
---
.../src/integrationtests/test-wallet-balance.ts | 8 +-------
packages/taler-wallet-core/src/operations/pay.ts | 14 ++++++++++++++
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git
a/packages/taler-wallet-cli/src/integrationtests/test-wallet-balance.ts
b/packages/taler-wallet-cli/src/integrationtests/test-wallet-balance.ts
index 025762e35..f5226c6c0 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-wallet-balance.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-wallet-balance.ts
@@ -21,10 +21,8 @@ import { Duration, PreparePayResultType } from
"@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
import {
- BankService,
ExchangeService,
FakebankService,
- getPayto,
getRandomIban,
GlobalTestState,
MerchantPrivateApi,
@@ -32,11 +30,7 @@ import {
setupDb,
WalletCli,
} from "../harness/harness.js";
-import {
- createSimpleTestkudosEnvironment,
- withdrawViaBank,
- makeTestPayment,
-} from "../harness/helpers.js";
+import { withdrawViaBank } from "../harness/helpers.js";
/**
* Test for wallet balance error messages / different types of insufficient
balance.
diff --git a/packages/taler-wallet-core/src/operations/pay.ts
b/packages/taler-wallet-core/src/operations/pay.ts
index 52b23713d..a498ab28d 100644
--- a/packages/taler-wallet-core/src/operations/pay.ts
+++ b/packages/taler-wallet-core/src/operations/pay.ts
@@ -47,6 +47,7 @@ import {
j2s,
Logger,
NotificationType,
+ parsePaytoUri,
parsePayUri,
PayCoinSelection,
PreparePayResult,
@@ -898,6 +899,19 @@ export async function selectCandidates(
if (exchangeDetails?.currency !== req.contractTermsAmount.currency) {
continue;
}
+ let wireMethodSupported = false;
+ for (const acc of exchangeDetails.wireInfo.accounts) {
+ const pp = parsePaytoUri(acc.payto_uri);
+ checkLogicInvariant(!!pp);
+ if (pp.targetType === req.wireMethod) {
+ wireMethodSupported = true;
+ break;
+ }
+ }
+ if (!wireMethodSupported) {
+ break;
+ }
+ exchangeDetails.wireInfo.accounts;
let accepted = false;
for (const allowedExchange of req.exchanges) {
if (allowedExchange.exchangePub === exchangeDetails.masterPublicKey)
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: wallet-core: add wire method check in new coin selection,
gnunet <=