taler-typescript-core

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

commit 007c75084c3f26aa0d6e3c438b541ea0dd3ba598
parent 4eb724cd4e897b7157cbaf72c7eb0585d550d30a
Author: Florian Dold <florian@dold.me>
Date:   Mon,  1 Jul 2024 15:19:32 +0200

wallet-core: logging

Diffstat:
Mpackages/taler-wallet-core/src/testing.ts | 4++--
Mpackages/taler-wallet-core/src/wallet.ts | 4++--
Mpackages/taler-wallet-core/src/withdraw.ts | 18+++++++++++++++++-
3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/packages/taler-wallet-core/src/testing.ts b/packages/taler-wallet-core/src/testing.ts @@ -80,7 +80,7 @@ import { initiatePeerPushDebit } from "./pay-peer-push-debit.js"; import { getRefreshesForTransaction } from "./refresh.js"; import { getTransactionById, getTransactions } from "./transactions.js"; import type { WalletExecutionContext } from "./wallet.js"; -import { acceptWithdrawalFromUri } from "./withdraw.js"; +import { acceptBankIntegratedWithdrawal } from "./withdraw.js"; const logger = new Logger("operations/testing.ts"); @@ -128,7 +128,7 @@ export async function withdrawTestBalance( await fetchFreshExchange(wex, req.exchangeBaseUrl); await acceptExchangeTermsOfService(wex, req.exchangeBaseUrl); - const acceptResp = await acceptWithdrawalFromUri(wex, { + const acceptResp = await acceptBankIntegratedWithdrawal(wex, { talerWithdrawUri: wresp.taler_withdraw_uri, selectedExchange: exchangeBaseUrl, forcedDenomSel: req.forcedDenomSel, diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts @@ -357,7 +357,7 @@ import { WalletCoreResponseType, } from "./wallet-api-types.js"; import { - acceptWithdrawalFromUri, + acceptBankIntegratedWithdrawal, confirmWithdrawal, createManualWithdrawal, getWithdrawalDetailsForAmount, @@ -1366,7 +1366,7 @@ async function handleAcceptBankIntegratedWithdrawal( wex: WalletExecutionContext, req: AcceptBankIntegratedWithdrawalRequest, ): Promise<AcceptWithdrawalResponse> { - return await acceptWithdrawalFromUri(wex, { + return await acceptBankIntegratedWithdrawal(wex, { selectedExchange: req.exchangeBaseUrl, talerWithdrawUri: req.talerWithdrawUri, forcedDenomSel: req.forcedDenomSel, diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts @@ -3292,7 +3292,7 @@ export async function confirmWithdrawal( * * @deprecated in favor of prepare/accept */ -export async function acceptWithdrawalFromUri( +export async function acceptBankIntegratedWithdrawal( wex: WalletExecutionContext, req: { talerWithdrawUri: string; @@ -3302,6 +3302,12 @@ export async function acceptWithdrawalFromUri( amount?: AmountLike; }, ): Promise<AcceptWithdrawalResponse> { + + wex.oc.observe({ + type: ObservabilityEventType.Message, + contents: "at start of acceptBankIntegratedWithdrawal", + }); + const selectedExchange = req.selectedExchange; logger.info( `preparing withdrawal via ${req.talerWithdrawUri}, canonicalized selected exchange ${selectedExchange}`, @@ -3311,6 +3317,11 @@ export async function acceptWithdrawalFromUri( talerWithdrawUri: req.talerWithdrawUri, }); + wex.oc.observe({ + type: ObservabilityEventType.Message, + contents: "prepared acceptBankIntegratedWithdrawal", + }); + let amount: AmountString; if (p.info.amount == null) { if (req.amount == null) { @@ -3344,6 +3355,11 @@ export async function acceptWithdrawalFromUri( forcedDenomSel: req.forcedDenomSel, }); + wex.oc.observe({ + type: ObservabilityEventType.Message, + contents: "confirmed acceptBankIntegratedWithdrawal", + }); + const newWithdrawralGroup = await wex.db.runReadOnlyTx( { storeNames: ["withdrawalGroups"] }, async (tx) => {