summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/refresh.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-20 00:57:02 +0100
committerFlorian Dold <florian@dold.me>2024-02-20 00:57:02 +0100
commit578bd4b1ed12049800556460359cb55a1e8545a2 (patch)
tree8d7846882b342ceaa1048d5a42120ae973d6ce49 /packages/taler-wallet-core/src/refresh.ts
parente10df554c9746971be0ec3f39a9cd98520066380 (diff)
downloadwallet-core-578bd4b1ed12049800556460359cb55a1e8545a2.tar.gz
wallet-core-578bd4b1ed12049800556460359cb55a1e8545a2.tar.bz2
wallet-core-578bd4b1ed12049800556460359cb55a1e8545a2.zip
taler-harness: test for balance during a pending refresh operation
Diffstat (limited to 'packages/taler-wallet-core/src/refresh.ts')
-rw-r--r--packages/taler-wallet-core/src/refresh.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/refresh.ts b/packages/taler-wallet-core/src/refresh.ts
index df0ab25f9..09cd75bdd 100644
--- a/packages/taler-wallet-core/src/refresh.ts
+++ b/packages/taler-wallet-core/src/refresh.ts
@@ -54,6 +54,7 @@ import {
TransactionState,
TransactionType,
URL,
+ WalletNotification,
} from "@gnu-taler/taler-util";
import {
readSuccessResponseJsonOrThrow,
@@ -1254,6 +1255,7 @@ async function applyRefresh(
export interface CreateRefreshGroupResult {
refreshGroupId: string;
+ notifications: WalletNotification[];
}
/**
@@ -1310,6 +1312,8 @@ export async function createRefreshGroup(
await tx.refreshGroups.put(refreshGroup);
+ const newTxState = computeRefreshTransactionState(refreshGroup);
+
logger.trace(`created refresh group ${refreshGroupId}`);
const ctx = new RefreshTransactionContext(ws, refreshGroupId);
@@ -1321,6 +1325,16 @@ export async function createRefreshGroup(
return {
refreshGroupId,
+ notifications: [
+ {
+ type: NotificationType.TransactionStateTransition,
+ transactionId: ctx.transactionId,
+ oldTxState: {
+ major: TransactionMajorState.None,
+ },
+ newTxState,
+ },
+ ],
};
}