diff options
Diffstat (limited to 'packages/taler-wallet-core/src/pay-peer-push-credit.ts')
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-push-credit.ts | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/packages/taler-wallet-core/src/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/pay-peer-push-credit.ts index 772007bb6..be2b3a7bc 100644 --- a/packages/taler-wallet-core/src/pay-peer-push-credit.ts +++ b/packages/taler-wallet-core/src/pay-peer-push-credit.ts @@ -17,7 +17,6 @@ import { AcceptPeerPushPaymentResponse, Amounts, - CancellationToken, ConfirmPeerPushCreditRequest, ContractTermsUtil, ExchangePurseMergeRequest, @@ -83,7 +82,7 @@ import { notifyTransition, parseTransactionIdentifier, } from "./transactions.js"; -import { InternalWalletState, WalletExecutionContext } from "./wallet.js"; +import { WalletExecutionContext } from "./wallet.js"; import { PerformCreateWithdrawalGroupResult, getExchangeWithdrawalInfo, @@ -252,8 +251,8 @@ export class PeerPushCreditTransactionContext implements TransactionContext { } async resumeTransaction(): Promise<void> { - const { wex: ws, peerPushCreditId, taskId: retryTag, transactionId } = this; - const transitionInfo = await ws.db.runReadWriteTx( + const { wex, peerPushCreditId, taskId: retryTag, transactionId } = this; + const transitionInfo = await wex.db.runReadWriteTx( ["peerPushCredit"], async (tx) => { const pushCreditRec = await tx.peerPushCredit.get(peerPushCreditId); @@ -300,13 +299,13 @@ export class PeerPushCreditTransactionContext implements TransactionContext { return undefined; }, ); - notifyTransition(ws, transactionId, transitionInfo); - ws.taskScheduler.startShepherdTask(retryTag); + notifyTransition(wex, transactionId, transitionInfo); + wex.taskScheduler.startShepherdTask(retryTag); } async failTransaction(): Promise<void> { - const { wex: ws, peerPushCreditId, taskId: retryTag, transactionId } = this; - const transitionInfo = await ws.db.runReadWriteTx( + const { wex, peerPushCreditId, taskId: retryTag, transactionId } = this; + const transitionInfo = await wex.db.runReadWriteTx( ["peerPushCredit"], async (tx) => { const pushCreditRec = await tx.peerPushCredit.get(peerPushCreditId); @@ -348,9 +347,9 @@ export class PeerPushCreditTransactionContext implements TransactionContext { return undefined; }, ); - ws.taskScheduler.stopShepherdTask(retryTag); - notifyTransition(ws, transactionId, transitionInfo); - ws.taskScheduler.startShepherdTask(retryTag); + wex.taskScheduler.stopShepherdTask(retryTag); + notifyTransition(wex, transactionId, transitionInfo); + wex.taskScheduler.startShepherdTask(retryTag); } } @@ -706,11 +705,7 @@ async function handlePendingMerge( const respJson = await mergeHttpResp.json(); const kycPending = codecForWalletKycUuid().decode(respJson); logger.info(`kyc uuid response: ${j2s(kycPending)}`); - return processPeerPushCreditKycRequired( - wex, - peerInc, - kycPending, - ); + return processPeerPushCreditKycRequired(wex, peerInc, kycPending); } logger.trace(`merge request: ${j2s(mergeReq)}`); |