summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-01-08 17:58:14 -0300
committerSebastian <sebasjm@gmail.com>2024-01-08 17:59:30 -0300
commitf366084d070a3f59bbdfe1fe1d31a0f3719d5c1c (patch)
tree8454b5f30ac488027ef69cae8e47dc1fc9546d66
parente9683e5ae9d3f7e6f3e16d01a280592075861548 (diff)
downloadwallet-core-f366084d070a3f59bbdfe1fe1d31a0f3719d5c1c.tar.gz
wallet-core-f366084d070a3f59bbdfe1fe1d31a0f3719d5c1c.tar.bz2
wallet-core-f366084d070a3f59bbdfe1fe1d31a0f3719d5c1c.zip
fixing wrong break statements
-rw-r--r--packages/taler-wallet-core/src/util/coinSelection.ts20
-rw-r--r--packages/taler-wallet-webextension/src/platform/chrome.ts2
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
index f24184609..6070f4c78 100644
--- 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
index 20cf54035..68fa63474 100644
--- 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;