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-credit.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-credit.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts b/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts index c0b728567..725e3f3d9 100644 --- a/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts +++ b/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts @@ -26,6 +26,7 @@ import { InitiatePeerPullCreditRequest, InitiatePeerPullCreditResponse, Logger, + NotificationType, TalerErrorCode, TalerPreciseTimestamp, TalerUriAction, @@ -785,24 +786,14 @@ export async function initiatePeerPullPayment( }); }); - // FIXME: Should we somehow signal to the client - // whether purse creation has failed, or does the client/ - // check this asynchronously from the transaction status? - - const taskId = constructTaskIdentifier({ - tag: PendingTaskType.PeerPullCredit, - pursePub: pursePair.pub, - }); - - await runTaskWithErrorReporting(ws, taskId, async () => { - return processPeerPullCredit(ws, pursePair.pub); - }); - const transactionId = constructTransactionIdentifier({ tag: TransactionType.PeerPullCredit, pursePub: pursePair.pub, }); + // The pending-incoming balance has changed. + ws.notify({ type: NotificationType.BalanceChange }); + return { talerUri: stringifyTalerUri({ type: TalerUriAction.PayPull, |