aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts19
1 files changed, 17 insertions, 2 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts b/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts
index def2462e0..3c47f30db 100644
--- a/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts
+++ b/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts
@@ -22,6 +22,7 @@ import {
Duration,
durationFromSpec,
MerchantApiClient,
+ NotificationType,
PreparePayResultType,
} from "@gnu-taler/taler-util";
import {
@@ -124,6 +125,12 @@ export async function runTimetravelAutorefreshTest(t: GlobalTestState) {
});
await wres.withdrawalFinishedCond;
+ const exchangeUpdated1Cond = walletClient.waitForNotificationCond(
+ (x) =>
+ x.type === NotificationType.ExchangeStateTransition &&
+ x.exchangeBaseUrl === exchange.baseUrl,
+ );
+
// Travel into the future, the deposit expiration is two years
// into the future.
console.log("applying first time travel");
@@ -142,7 +149,8 @@ export async function runTimetravelAutorefreshTest(t: GlobalTestState) {
console.log("pending operations after first time travel");
console.log(JSON.stringify(p, undefined, 2));
- await walletClient.call(WalletApiOperation.TestingWaitTasksProcessed, {});
+ // The time travel should cause exchanges to update.
+ await exchangeUpdated1Cond;
await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
const wres2 = await withdrawViaBankV2(t, {
@@ -155,6 +163,12 @@ export async function runTimetravelAutorefreshTest(t: GlobalTestState) {
await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
+ const exchangeUpdated2Cond = walletClient.waitForNotificationCond(
+ (x) =>
+ x.type === NotificationType.ExchangeStateTransition &&
+ x.exchangeBaseUrl === exchange.baseUrl,
+ );
+
// Travel into the future, the deposit expiration is two years
// into the future.
console.log("applying second time travel");
@@ -167,7 +181,8 @@ export async function runTimetravelAutorefreshTest(t: GlobalTestState) {
},
);
- await walletClient.call(WalletApiOperation.TestingWaitTasksProcessed, {});
+ // The time travel should cause exchanges to update.
+ await exchangeUpdated2Cond;
await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
// At this point, the original coins should've been refreshed.