From 3d6cff9c8400c2b5d1b5a0ce149656801b2300fe Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 25 Aug 2023 11:22:52 +0200 Subject: harness: modernize some tests, temporarily disable revocation test --- .../src/integrationtests/test-fee-regression.ts | 40 +++++++++++++--------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'packages/taler-harness/src/integrationtests/test-fee-regression.ts') diff --git a/packages/taler-harness/src/integrationtests/test-fee-regression.ts b/packages/taler-harness/src/integrationtests/test-fee-regression.ts index 8c5a5bea4..e0dc4bc3b 100644 --- a/packages/taler-harness/src/integrationtests/test-fee-regression.ts +++ b/packages/taler-harness/src/integrationtests/test-fee-regression.ts @@ -19,18 +19,18 @@ */ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { - GlobalTestState, BankService, ExchangeService, + GlobalTestState, MerchantService, - setupDb, - WalletCli, getPayto, + setupDb, } from "../harness/harness.js"; import { - withdrawViaBank, - makeTestPayment, - SimpleTestEnvironment, + SimpleTestEnvironmentNg, + createWalletDaemonWithClient, + makeTestPaymentV2, + withdrawViaBankV2, } from "../harness/helpers.js"; /** @@ -39,7 +39,7 @@ import { */ export async function createMyTestkudosEnvironment( t: GlobalTestState, -): Promise { +): Promise { const db = await setupDb(t); const bank = await BankService.create(t, { @@ -147,13 +147,19 @@ export async function createMyTestkudosEnvironment( console.log("setup done!"); - const wallet = new WalletCli(t); + const { walletClient, walletService } = await createWalletDaemonWithClient( + t, + { + name: "w1", + }, + ); return { commonDb: db, exchange, merchant, - wallet, + walletClient, + walletService, bank, exchangeBankAccount, }; @@ -165,19 +171,21 @@ export async function createMyTestkudosEnvironment( export async function runFeeRegressionTest(t: GlobalTestState) { // Set up test environment - const { wallet, bank, exchange, merchant } = + const { walletClient, bank, exchange, merchant } = await createMyTestkudosEnvironment(t); // Withdraw digital cash into the wallet. - await withdrawViaBank(t, { - wallet, + const wres = await withdrawViaBankV2(t, { + walletClient, bank, exchange, amount: "TESTKUDOS:1.92", }); - const coins = await wallet.client.call(WalletApiOperation.DumpCoins, {}); + await wres.withdrawalFinishedCond; + + const coins = await walletClient.call(WalletApiOperation.DumpCoins, {}); // Make sure we really withdraw one 0.64 and one 1.28 coin. t.assertTrue(coins.coins.length === 2); @@ -188,11 +196,11 @@ export async function runFeeRegressionTest(t: GlobalTestState) { fulfillment_url: "taler://fulfillment-success/thx", }; - await makeTestPayment(t, { wallet, merchant, order }); + await makeTestPaymentV2(t, { walletClient, merchant, order }); - await wallet.runUntilDone(); + await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); - const txs = await wallet.client.call(WalletApiOperation.GetTransactions, {}); + const txs = await walletClient.call(WalletApiOperation.GetTransactions, {}); t.assertAmountEquals(txs.transactions[1].amountEffective, "TESTKUDOS:1.30"); console.log(txs); } -- cgit v1.2.3