aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/shepherd.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-19 18:20:43 +0100
committerFlorian Dold <florian@dold.me>2024-02-19 18:20:43 +0100
commite888d7f292f68a58fc4b56771fb8a38219d53b86 (patch)
tree54f2eab7c510cee5a2b90b6b2ccba94a437d8f91 /packages/taler-wallet-core/src/shepherd.ts
parente951075d2ef52fa8e9e7489c62031777c3a7e66b (diff)
downloadwallet-core-e888d7f292f68a58fc4b56771fb8a38219d53b86.tar.xz
wallet-core: fix import paths, remove unused code, thread through cancellation tokens
Diffstat (limited to 'packages/taler-wallet-core/src/shepherd.ts')
-rw-r--r--packages/taler-wallet-core/src/shepherd.ts32
1 files changed, 20 insertions, 12 deletions
diff --git a/packages/taler-wallet-core/src/shepherd.ts b/packages/taler-wallet-core/src/shepherd.ts
index 438b4cf84..462d51a0d 100644
--- a/packages/taler-wallet-core/src/shepherd.ts
+++ b/packages/taler-wallet-core/src/shepherd.ts
@@ -37,14 +37,6 @@ import {
j2s,
makeErrorDetail,
} from "@gnu-taler/taler-util";
-import { CryptoApiStoppedError } from "./crypto/workers/crypto-dispatcher.js";
-import {
- OPERATION_STATUS_ACTIVE_FIRST,
- OPERATION_STATUS_ACTIVE_LAST,
- WalletDbAllStoresReadOnlyTransaction,
- timestampAbsoluteFromDb,
-} from "./index.js";
-import { InternalWalletState } from "./internal-wallet-state.js";
import { processBackupForProvider } from "./backup/index.js";
import {
DbRetryInfo,
@@ -54,18 +46,26 @@ import {
getExchangeState,
parseTaskIdentifier,
} from "./common.js";
+import { CryptoApiStoppedError } from "./crypto/workers/crypto-dispatcher.js";
import { processDepositGroup } from "./deposits.js";
import { updateExchangeFromUrlHandler } from "./exchanges.js";
+import {
+ OPERATION_STATUS_ACTIVE_FIRST,
+ OPERATION_STATUS_ACTIVE_LAST,
+ WalletDbAllStoresReadOnlyTransaction,
+ timestampAbsoluteFromDb,
+} from "./index.js";
+import { InternalWalletState } from "./internal-wallet-state.js";
import { processPurchase } from "./pay-merchant.js";
import { processPeerPullCredit } from "./pay-peer-pull-credit.js";
import { processPeerPullDebit } from "./pay-peer-pull-debit.js";
import { processPeerPushCredit } from "./pay-peer-push-credit.js";
import { processPeerPushDebit } from "./pay-peer-push-debit.js";
+import { PendingTaskType, TaskId } from "./pending-types.js";
import { processRecoupGroup } from "./recoup.js";
import { processRefreshGroup } from "./refresh.js";
import { constructTransactionIdentifier } from "./transactions.js";
import { processWithdrawalGroup } from "./withdraw.js";
-import { PendingTaskType, TaskId } from "./pending-types.js";
const logger = new Logger("shepherd.ts");
@@ -518,9 +518,13 @@ async function callOperationHandlerForTaskId(
cancellationToken,
);
case PendingTaskType.Purchase:
- return await processPurchase(ws, pending.proposalId);
+ return await processPurchase(ws, pending.proposalId, cancellationToken);
case PendingTaskType.Recoup:
- return await processRecoupGroup(ws, pending.recoupGroupId);
+ return await processRecoupGroup(
+ ws,
+ pending.recoupGroupId,
+ cancellationToken,
+ );
case PendingTaskType.Deposit:
return await processDepositGroup(
ws,
@@ -542,7 +546,11 @@ async function callOperationHandlerForTaskId(
cancellationToken,
);
case PendingTaskType.PeerPullDebit:
- return await processPeerPullDebit(ws, pending.peerPullDebitId);
+ return await processPeerPullDebit(
+ ws,
+ pending.peerPullDebitId,
+ cancellationToken,
+ );
case PendingTaskType.PeerPushCredit:
return await processPeerPushCredit(
ws,