diff options
author | Florian Dold <florian@dold.me> | 2024-07-01 15:19:32 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-07-01 15:19:32 +0200 |
commit | 007c75084c3f26aa0d6e3c438b541ea0dd3ba598 (patch) | |
tree | 8c3abb84cd6de7ca67c41e1c0af1b167487ae305 /packages/taler-wallet-core | |
parent | 4eb724cd4e897b7157cbaf72c7eb0585d550d30a (diff) | |
download | wallet-core-007c75084c3f26aa0d6e3c438b541ea0dd3ba598.tar.xz |
wallet-core: logging
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/testing.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 4 | ||||
-rw-r--r-- | packages/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 index 6435595cb..225773f8c 100644 --- 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 index 614310cb6..1f2686cc9 100644 --- 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 index 3e2f4411f..229727a54 100644 --- 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) => { |