aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-fee-regression.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-08-25 11:22:52 +0200
committerFlorian Dold <florian@dold.me>2023-08-25 11:22:52 +0200
commit3d6cff9c8400c2b5d1b5a0ce149656801b2300fe (patch)
treee614d213872769e90e640b0a8665246858ebe5e6 /packages/taler-harness/src/integrationtests/test-fee-regression.ts
parent6cc3fb3d0466e89b67be271009a2fc95f3ed41ca (diff)
downloadwallet-core-3d6cff9c8400c2b5d1b5a0ce149656801b2300fe.tar.xz
harness: modernize some tests, temporarily disable revocation test
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-fee-regression.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-fee-regression.ts40
1 files changed, 24 insertions, 16 deletions
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<SimpleTestEnvironment> {
+): Promise<SimpleTestEnvironmentNg> {
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);
}