diff options
author | Florian Dold <florian@dold.me> | 2023-06-28 10:49:31 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-06-28 10:49:41 +0200 |
commit | 35ae9f2c22adcabd28747a1f2c4f21f51c732f42 (patch) | |
tree | 00f906371bb64ab6479d2fb203bf188e5da46b49 /packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts | |
parent | 97a9e92d8b104a94c376ae4fad8c5c811f5ef7e1 (diff) |
wallet-core: emit balance-change notifications, do less implicit background work
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts b/packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts index c7b59e6db..9d8fabfb2 100644 --- a/packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts +++ b/packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts @@ -22,6 +22,7 @@ import { ExchangePurseDeposits, HttpStatusCode, Logger, + NotificationType, PeerContractTerms, PreparePeerPullDebitRequest, PreparePeerPullDebitResponse, @@ -388,7 +389,6 @@ export async function confirmPeerPullDebit( ws: InternalWalletState, req: ConfirmPeerPullDebitRequest, ): Promise<AcceptPeerPullPaymentResponse> { - let peerPullPaymentIncomingId: string; if (req.transactionId) { @@ -400,7 +400,9 @@ export async function confirmPeerPullDebit( } else if (req.peerPullPaymentIncomingId) { peerPullPaymentIncomingId = req.peerPullPaymentIncomingId; } else { - throw Error("invalid request, transactionId or peerPullPaymentIncomingId required"); + throw Error( + "invalid request, transactionId or peerPullPaymentIncomingId required", + ); } const peerPullInc = await ws.db @@ -479,13 +481,7 @@ export async function confirmPeerPullDebit( return pi; }); - await runTaskWithErrorReporting( - ws, - TaskIdentifiers.forPeerPullPaymentDebit(ppi), - async () => { - return processPeerPullDebit(ws, ppi.peerPullPaymentIncomingId); - }, - ); + ws.notify({ type: NotificationType.BalanceChange }); const transactionId = constructTransactionIdentifier({ tag: TransactionType.PeerPullDebit, |