summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/reward.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/reward.ts')
-rw-r--r--packages/taler-wallet-core/src/reward.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/packages/taler-wallet-core/src/reward.ts b/packages/taler-wallet-core/src/reward.ts
index 51eb0f5bd..b8cf41326 100644
--- a/packages/taler-wallet-core/src/reward.ts
+++ b/packages/taler-wallet-core/src/reward.ts
@@ -42,7 +42,7 @@ import {
constructTransactionIdentifier,
notifyTransition,
} from "./transactions.js";
-import { InternalWalletState } from "./wallet.js";
+import { InternalWalletState, WalletExecutionContext } from "./wallet.js";
const logger = new Logger("operations/tip.ts");
@@ -51,7 +51,7 @@ export class RewardTransactionContext implements TransactionContext {
public taskId: TaskIdStr;
constructor(
- public ws: InternalWalletState,
+ public wex: WalletExecutionContext,
public walletRewardId: string,
) {
this.transactionId = constructTransactionIdentifier({
@@ -65,8 +65,8 @@ export class RewardTransactionContext implements TransactionContext {
}
async deleteTransaction(): Promise<void> {
- const { ws, walletRewardId } = this;
- await ws.db.runReadWriteTx(["rewards", "tombstones"], async (tx) => {
+ const { wex, walletRewardId } = this;
+ await wex.db.runReadWriteTx(["rewards", "tombstones"], async (tx) => {
const tipRecord = await tx.rewards.get(walletRewardId);
if (tipRecord) {
await tx.rewards.delete(walletRewardId);
@@ -78,8 +78,8 @@ export class RewardTransactionContext implements TransactionContext {
}
async suspendTransaction(): Promise<void> {
- const { ws, walletRewardId, transactionId, taskId: retryTag } = this;
- const transitionInfo = await ws.db.runReadWriteTx(
+ const { wex, walletRewardId, transactionId, taskId } = this;
+ const transitionInfo = await wex.db.runReadWriteTx(
["rewards"],
async (tx) => {
const tipRec = await tx.rewards.get(walletRewardId);
@@ -115,12 +115,12 @@ export class RewardTransactionContext implements TransactionContext {
return undefined;
},
);
- notifyTransition(ws, transactionId, transitionInfo);
+ notifyTransition(wex, transactionId, transitionInfo);
}
async abortTransaction(): Promise<void> {
- const { ws, walletRewardId, transactionId, taskId: retryTag } = this;
- const transitionInfo = await ws.db.runReadWriteTx(
+ const { wex, walletRewardId, transactionId } = this;
+ const transitionInfo = await wex.db.runReadWriteTx(
["rewards"],
async (tx) => {
const tipRec = await tx.rewards.get(walletRewardId);
@@ -155,11 +155,11 @@ export class RewardTransactionContext implements TransactionContext {
return undefined;
},
);
- notifyTransition(ws, transactionId, transitionInfo);
+ notifyTransition(wex, transactionId, transitionInfo);
}
async resumeTransaction(): Promise<void> {
- const { ws, walletRewardId, transactionId, taskId: retryTag } = this;
+ const { wex: ws, walletRewardId, transactionId, taskId: retryTag } = this;
const transitionInfo = await ws.db.runReadWriteTx(
["rewards"],
async (tx) => {
@@ -199,7 +199,7 @@ export class RewardTransactionContext implements TransactionContext {
}
async failTransaction(): Promise<void> {
- const { ws, walletRewardId, transactionId, taskId: retryTag } = this;
+ const { wex: ws, walletRewardId, transactionId, taskId: retryTag } = this;
const transitionInfo = await ws.db.runReadWriteTx(
["rewards"],
async (tx) => {