taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit f366084d070a3f59bbdfe1fe1d31a0f3719d5c1c
parent e9683e5ae9d3f7e6f3e16d01a280592075861548
Author: Sebastian <sebasjm@gmail.com>
Date:   Mon,  8 Jan 2024 17:58:14 -0300

fixing wrong break statements

Diffstat:
Mpackages/taler-wallet-core/src/util/coinSelection.ts | 20++++++++++----------
Mpackages/taler-wallet-webextension/src/platform/chrome.ts | 2+-
2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/packages/taler-wallet-core/src/util/coinSelection.ts b/packages/taler-wallet-core/src/util/coinSelection.ts @@ -233,9 +233,9 @@ function tallyFees( export type SelectPayCoinsResult = | { - type: "failure"; - insufficientBalanceDetails: PayMerchantInsufficientBalanceDetails; - } + type: "failure"; + insufficientBalanceDetails: PayMerchantInsufficientBalanceDetails; + } | { type: "success"; coinSel: PayCoinSelection }; /** @@ -614,7 +614,7 @@ async function selectPayMerchantCandidates( const denoms: AvailableDenom[] = []; const exchanges = await tx.exchanges.iter().toArray(); const wfPerExchange: Record<string, AmountJson> = {}; - for (const exchange of exchanges) { + loopExchange: for (const exchange of exchanges) { const exchangeDetails = await getExchangeWireDetailsInTx( tx, exchange.baseUrl, @@ -625,7 +625,7 @@ async function selectPayMerchantCandidates( } let wireMethodFee: string | undefined; // 2.- exchange supports wire method - for (const acc of exchangeDetails.wireInfo.accounts) { + loopWireAccount: for (const acc of exchangeDetails.wireInfo.accounts) { const pp = parsePaytoUri(acc.payto_uri); checkLogicInvariant(!!pp); if (pp.targetType !== req.wireMethod) { @@ -656,11 +656,11 @@ async function selectPayMerchantCandidates( if (wireFeeStr) { wireMethodFee = wireFeeStr; + break loopWireAccount; } - break; } if (!wireMethodFee) { - break; + continue; } wfPerExchange[exchange.baseUrl] = Amounts.parseOrThrow(wireMethodFee); @@ -889,9 +889,9 @@ export interface PeerCoinSelectionDetails { export type SelectPeerCoinsResult = | { type: "success"; result: PeerCoinSelectionDetails } | { - type: "failure"; - insufficientBalanceDetails: PayPeerInsufficientBalanceDetails; - }; + type: "failure"; + insufficientBalanceDetails: PayPeerInsufficientBalanceDetails; + }; export interface PeerCoinRepair { exchangeBaseUrl: string; diff --git a/packages/taler-wallet-webextension/src/platform/chrome.ts b/packages/taler-wallet-webextension/src/platform/chrome.ts @@ -742,7 +742,7 @@ function containsTalerHeaderListener(): boolean { function headerListener( details: chrome.webRequest.WebResponseHeadersDetails, ): chrome.webRequest.BlockingResponse | undefined { - logger.info("header listener run", details.statusCode, chrome.runtime.lastError) + logger.trace("header listener run", details.statusCode, chrome.runtime.lastError) if (chrome.runtime.lastError) { logger.error(JSON.stringify(chrome.runtime.lastError)); return;