diff options
author | Sebastian <sebasjm@gmail.com> | 2022-08-29 13:23:22 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-08-29 13:23:22 -0300 |
commit | 6610a0b9d7eb9fbec591f052c960f780732bf0e5 (patch) | |
tree | 8509c40bf1682d43bc8324d498cc22a15c81c3eb /packages/taler-wallet-core | |
parent | a5f052d69c6457ad0289fdcb56398ea1fabedc2a (diff) | |
download | wallet-core-6610a0b9d7eb9fbec591f052c960f780732bf0e5.tar.xz |
add senderWire to the withdrawal group again, group payto to avoid duplication
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 10 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 10 |
2 files changed, 11 insertions, 9 deletions
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 84890a043..1a73dc01c 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -242,7 +242,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; } @@ -903,8 +903,7 @@ 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}`, ); let valid = false; @@ -1031,7 +1030,7 @@ async function queryReserve( if ( resp.status === 404 && result.talerErrorResponse.code === - TalerErrorCode.EXCHANGE_RESERVES_STATUS_UNKNOWN + TalerErrorCode.EXCHANGE_RESERVES_STATUS_UNKNOWN ) { ws.notify({ type: NotificationType.ReserveNotYetFound, @@ -1337,7 +1336,7 @@ export async function getExchangeWithdrawalInfo( ) { logger.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`, ); } } @@ -1714,6 +1713,7 @@ async function processReserveBankStatus( } else { logger.info("withdrawal: transfer not yet confirmed by bank"); r.wgInfo.bankInfo.confirmUrl = status.confirm_transfer_url; + r.senderWire = status.sender_wire; r.retryInfo = RetryInfo.increment(r.retryInfo); } await tx.withdrawalGroups.put(r); diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 8ae4b2b7b..b3fee6bff 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -536,7 +536,7 @@ async function listKnownBankAccounts( ws: InternalWalletState, currency?: string, ): Promise<KnownBankAccounts> { - const accounts: PaytoUri[] = []; + const accounts: { [account: string]: PaytoUri } = {}; await ws.db .mktx((x) => ({ withdrawalGroups: x.withdrawalGroups, @@ -548,9 +548,11 @@ async function listKnownBankAccounts( if (currency && currency !== amount.currency) { continue; } - const payto = r.senderWire ? parsePaytoUri(r.senderWire) : undefined; - if (payto) { - accounts.push(payto); + if (r.senderWire) { + const payto = parsePaytoUri(r.senderWire); + if (payto) { + accounts[r.senderWire] = payto; + } } } }); |