aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-refund-gone.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-refund-gone.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-refund-gone.ts34
1 files changed, 21 insertions, 13 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-refund-gone.ts b/packages/taler-harness/src/integrationtests/test-refund-gone.ts
index 5f226c7dd..8e402f3fc 100644
--- a/packages/taler-harness/src/integrationtests/test-refund-gone.ts
+++ b/packages/taler-harness/src/integrationtests/test-refund-gone.ts
@@ -19,9 +19,9 @@
*/
import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js";
import {
- createSimpleTestkudosEnvironment,
- withdrawViaBank,
- applyTimeTravel,
+ applyTimeTravelV2,
+ createSimpleTestkudosEnvironmentV2,
+ withdrawViaBankV2,
} from "../harness/helpers.js";
import {
AbsoluteTime,
@@ -36,12 +36,17 @@ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
export async function runRefundGoneTest(t: GlobalTestState) {
// Set up test environment
- const { wallet, bank, exchange, merchant } =
- await createSimpleTestkudosEnvironment(t);
+ const { walletClient, bank, exchange, merchant } =
+ await createSimpleTestkudosEnvironmentV2(t);
// Withdraw digital cash into the wallet.
- await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:20" });
+ await withdrawViaBankV2(t, {
+ walletClient,
+ bank,
+ exchange,
+ amount: "TESTKUDOS:20",
+ });
// Set up order.
@@ -72,11 +77,11 @@ export async function runRefundGoneTest(t: GlobalTestState) {
// Make wallet pay for the order
- const r1 = await wallet.client.call(WalletApiOperation.PreparePayForUri, {
+ const r1 = await walletClient.call(WalletApiOperation.PreparePayForUri, {
talerPayUri: orderStatus.taler_pay_uri,
});
- const r2 = await wallet.client.call(WalletApiOperation.ConfirmPay, {
+ const r2 = await walletClient.call(WalletApiOperation.ConfirmPay, {
proposalId: r1.proposalId,
});
@@ -90,7 +95,10 @@ export async function runRefundGoneTest(t: GlobalTestState) {
console.log(orderStatus);
- await applyTimeTravel(durationFromSpec({ hours: 1 }), { exchange, wallet });
+ await applyTimeTravelV2(
+ Duration.toMilliseconds(Duration.fromSpec({ hours: 1 })),
+ { exchange, walletClient: walletClient },
+ );
await exchange.runAggregatorOnce();
@@ -103,16 +111,16 @@ export async function runRefundGoneTest(t: GlobalTestState) {
console.log(ref);
- await wallet.client.call(WalletApiOperation.StartRefundQuery, {
+ await walletClient.call(WalletApiOperation.StartRefundQuery, {
transactionId: r1.transactionId,
});
- await wallet.runUntilDone();
+ await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
- let r = await wallet.client.call(WalletApiOperation.GetBalances, {});
+ let r = await walletClient.call(WalletApiOperation.GetBalances, {});
console.log(JSON.stringify(r, undefined, 2));
- const r3 = await wallet.client.call(WalletApiOperation.GetTransactions, {});
+ const r3 = await walletClient.call(WalletApiOperation.GetTransactions, {});
console.log(JSON.stringify(r3, undefined, 2));
await t.shutdown();