aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/withdraw.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-27 22:23:11 +0100
committerFlorian Dold <florian@dold.me>2024-02-27 22:23:11 +0100
commitd3572014b06f60250e3bb9e99898b89cd11a4294 (patch)
treed98879e8198cc748513b4c331ee3a764ea10638e /packages/taler-wallet-core/src/withdraw.ts
parentf08798520ef9b8b0ff36c6aaf93653605b53b912 (diff)
downloadwallet-core-d3572014b06f60250e3bb9e99898b89cd11a4294.tar.xz
observability
Diffstat (limited to 'packages/taler-wallet-core/src/withdraw.ts')
-rw-r--r--packages/taler-wallet-core/src/withdraw.ts44
1 files changed, 15 insertions, 29 deletions
diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts
index 44f1ee4f9..e3c4e66a2 100644
--- a/packages/taler-wallet-core/src/withdraw.ts
+++ b/packages/taler-wallet-core/src/withdraw.ts
@@ -146,11 +146,7 @@ import {
WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,
WALLET_EXCHANGE_PROTOCOL_VERSION,
} from "./versions.js";
-import {
- WalletExecutionContext,
- getDenomInfo,
- type InternalWalletState,
-} from "./wallet.js";
+import { WalletExecutionContext, getDenomInfo } from "./wallet.js";
/**
* Logger for this file.
@@ -249,8 +245,8 @@ export class WithdrawTransactionContext implements TransactionContext {
}
async abortTransaction(): Promise<void> {
- const { wex: ws, withdrawalGroupId, transactionId, taskId } = this;
- const transitionInfo = await ws.db.runReadWriteTx(
+ const { wex, withdrawalGroupId, transactionId, taskId } = this;
+ const transitionInfo = await wex.db.runReadWriteTx(
["withdrawalGroups"],
async (tx) => {
const wg = await tx.withdrawalGroups.get(withdrawalGroupId);
@@ -305,19 +301,14 @@ export class WithdrawTransactionContext implements TransactionContext {
return undefined;
},
);
- ws.taskScheduler.stopShepherdTask(taskId);
- notifyTransition(ws, transactionId, transitionInfo);
- ws.taskScheduler.startShepherdTask(taskId);
+ wex.taskScheduler.stopShepherdTask(taskId);
+ notifyTransition(wex, transactionId, transitionInfo);
+ wex.taskScheduler.startShepherdTask(taskId);
}
async resumeTransaction(): Promise<void> {
- const {
- wex: ws,
- withdrawalGroupId,
- transactionId,
- taskId: retryTag,
- } = this;
- const transitionInfo = await ws.db.runReadWriteTx(
+ const { wex, withdrawalGroupId, transactionId, taskId: retryTag } = this;
+ const transitionInfo = await wex.db.runReadWriteTx(
["withdrawalGroups"],
async (tx) => {
const wg = await tx.withdrawalGroups.get(withdrawalGroupId);
@@ -366,18 +357,13 @@ export class WithdrawTransactionContext 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,
- withdrawalGroupId,
- transactionId,
- taskId: retryTag,
- } = this;
- const stateUpdate = await ws.db.runReadWriteTx(
+ const { wex, withdrawalGroupId, transactionId, taskId: retryTag } = this;
+ const stateUpdate = await wex.db.runReadWriteTx(
["withdrawalGroups"],
async (tx) => {
const wg = await tx.withdrawalGroups.get(withdrawalGroupId);
@@ -407,9 +393,9 @@ export class WithdrawTransactionContext implements TransactionContext {
return undefined;
},
);
- ws.taskScheduler.stopShepherdTask(retryTag);
- notifyTransition(ws, transactionId, stateUpdate);
- ws.taskScheduler.startShepherdTask(retryTag);
+ wex.taskScheduler.stopShepherdTask(retryTag);
+ notifyTransition(wex, transactionId, stateUpdate);
+ wex.taskScheduler.startShepherdTask(retryTag);
}
}