aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core
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 /packages/taler-wallet-core
parente9683e5ae9d3f7e6f3e16d01a280592075861548 (diff)
downloadwallet-core-f366084d070a3f59bbdfe1fe1d31a0f3719d5c1c.tar.xz
fixing wrong break statements
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r--packages/taler-wallet-core/src/util/coinSelection.ts20
1 files changed, 10 insertions, 10 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;