diff options
74 files changed, 353 insertions, 146 deletions
diff --git a/packages/taler-wallet-cli/src/bench1.ts b/packages/taler-wallet-cli/src/bench1.ts new file mode 100644 index 000000000..5563fc453 --- /dev/null +++ b/packages/taler-wallet-cli/src/bench1.ts @@ -0,0 +1,89 @@ +/* + This file is part of GNU Taler + (C) 2021 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + +/** + * Imports. + */ +import { buildCodecForObject, codecForString } from "@gnu-taler/taler-util"; +import { + getDefaultNodeWallet, + NodeHttpLib, + WalletApiOperation, +} from "@gnu-taler/taler-wallet-core"; + +/** + * Entry point for the benchmark. + * + * The benchmark runs against an existing Taler deployment and does not + * set up its own services. + */ +export async function runBench1(configJson: any): Promise<void> { + // Validate the configuration file for this benchmark. + const b1conf = codecForBench1Config().decode(configJson); + + const myHttpLib = new NodeHttpLib(); + const wallet = await getDefaultNodeWallet({ + // No persistent DB storage. + persistentStoragePath: undefined, + httpLib: myHttpLib, + }); + await wallet.client.call(WalletApiOperation.InitWallet, {}); + + await wallet.client.call(WalletApiOperation.WithdrawFakebank, { + amount: "TESTKUDOS:10", + bank: b1conf.bank, + exchange: b1conf.exchange, + }); + + await wallet.runTaskLoop({ + stopWhenDone: true, + }); + + await wallet.client.call(WalletApiOperation.CreateDepositGroup, { + amount: "TESTKUDOS:5", + depositPaytoUri: "payto://x-taler-bank/localhost/foo", + }); + + await wallet.runTaskLoop({ + stopWhenDone: true, + }); + + wallet.stop(); +} + +/** + * Format of the configuration file passed to the benchmark + */ +interface Bench1Config { + /** + * Base URL of the bank. + */ + bank: string; + + /** + * Base URL of the exchange. + */ + exchange: string; +} + +/** + * Schema validation codec for Bench1Config. + */ +const codecForBench1Config = () => + buildCodecForObject<Bench1Config>() + .property("bank", codecForString()) + .property("exchange", codecForString()) + .build("Bench1Config"); diff --git a/packages/taler-wallet-cli/src/env1.ts b/packages/taler-wallet-cli/src/env1.ts new file mode 100644 index 000000000..eb7da352c --- /dev/null +++ b/packages/taler-wallet-cli/src/env1.ts @@ -0,0 +1,68 @@ +/* + This file is part of GNU Taler + (C) 2021 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + +/** + * Imports. + */ +import { URL } from "@gnu-taler/taler-util"; +import { CoinConfig, defaultCoinConfig } from "./harness/denomStructures.js"; +import { + GlobalTestState, + setupDb, + FakeBankService, + ExchangeService, +} from "./harness/harness.js"; + +/** + * Entry point for the benchmark. + * + * The benchmark runs against an existing Taler deployment and does not + * set up its own services. + */ +export async function runEnv1(t: GlobalTestState): Promise<void> { + const db = await setupDb(t); + + const bank = await FakeBankService.create(t, { + currency: "TESTKUDOS", + httpPort: 8082, + }); + + const exchange = ExchangeService.create(t, { + name: "testexchange-1", + currency: "TESTKUDOS", + httpPort: 8081, + database: db.connStr, + }); + + exchange.addBankAccount("1", { + accountName: "exchange", + accountPassword: "x", + wireGatewayApiBaseUrl: new URL("/exchange/", bank.baseUrl).href, + accountPaytoUri: "payto://x-taler-bank/localhost/exchange", + }); + + await bank.start(); + + await bank.pingUntilAvailable(); + + const coinConfig: CoinConfig[] = defaultCoinConfig.map((x) => x("TESTKUDOS")); + exchange.addCoinConfigList(coinConfig); + + await exchange.start(); + await exchange.pingUntilAvailable(); + + console.log("setup done!"); +} diff --git a/packages/taler-wallet-cli/src/integrationtests/denomStructures.ts b/packages/taler-wallet-cli/src/harness/denomStructures.ts index 5ab9aca00..5ab9aca00 100644 --- a/packages/taler-wallet-cli/src/integrationtests/denomStructures.ts +++ b/packages/taler-wallet-cli/src/harness/denomStructures.ts diff --git a/packages/taler-wallet-cli/src/integrationtests/faultInjection.ts b/packages/taler-wallet-cli/src/harness/faultInjection.ts index 474482ec0..4c3d0c123 100644 --- a/packages/taler-wallet-cli/src/integrationtests/faultInjection.ts +++ b/packages/taler-wallet-cli/src/harness/faultInjection.ts @@ -31,7 +31,7 @@ import { ExchangeServiceInterface, MerchantServiceInterface, MerchantService, -} from "./harness"; +} from "../harness/harness.js"; export interface FaultProxyConfig { inboundPort: number; diff --git a/packages/taler-wallet-cli/src/integrationtests/harness.ts b/packages/taler-wallet-cli/src/harness/harness.ts index 6644e567f..b4ac16dbf 100644 --- a/packages/taler-wallet-cli/src/integrationtests/harness.ts +++ b/packages/taler-wallet-cli/src/harness/harness.ts @@ -28,6 +28,7 @@ import * as util from "util"; import * as fs from "fs"; import * as path from "path"; import * as http from "http"; +import * as readline from "readline"; import { deepStrictEqual } from "assert"; import { ChildProcess, spawn } from "child_process"; import { URL } from "url"; @@ -1626,6 +1627,7 @@ export async function runTestWithState( gc: GlobalTestState, testMain: (t: GlobalTestState) => Promise<void>, testName: string, + linger: boolean = false, ): Promise<TestRunResult> { const startMs = new Date().getTime(); @@ -1649,6 +1651,19 @@ export async function runTestWithState( console.log("running test in directory", gc.testDir); await Promise.race([testMain(gc), p.promise]); status = "pass"; + if (linger) { + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + terminal: true, + }); + await new Promise<void>((resolve, reject) => { + rl.question("Press enter to shut down test.", () => { + resolve(); + }); + }); + rl.close(); + } } catch (e) { console.error("FATAL: test failed with exception", e); status = "fail"; diff --git a/packages/taler-wallet-cli/src/integrationtests/helpers.ts b/packages/taler-wallet-cli/src/harness/helpers.ts index 3b4e1643f..3b4e1643f 100644 --- a/packages/taler-wallet-cli/src/integrationtests/helpers.ts +++ b/packages/taler-wallet-cli/src/harness/helpers.ts diff --git a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts b/packages/taler-wallet-cli/src/harness/libeufin.ts index 2ee98952a..11447b389 100644 --- a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts +++ b/packages/taler-wallet-cli/src/harness/libeufin.ts @@ -19,7 +19,7 @@ */ import axios from "axios"; import { URL } from "@gnu-taler/taler-util"; -import { getRandomIban, getRandomString } from "./helpers"; +import { getRandomIban, getRandomString } from "../harness/helpers.js"; import { GlobalTestState, DbInfo, @@ -28,7 +28,7 @@ import { runCommand, setupDb, sh, -} from "./harness"; +} from "../harness/harness.js"; export interface LibeufinSandboxServiceInterface { baseUrl: string; diff --git a/packages/taler-wallet-cli/src/integrationtests/merchantApiTypes.ts b/packages/taler-wallet-cli/src/harness/merchantApiTypes.ts index a93a0ed25..a93a0ed25 100644 --- a/packages/taler-wallet-cli/src/integrationtests/merchantApiTypes.ts +++ b/packages/taler-wallet-cli/src/harness/merchantApiTypes.ts diff --git a/packages/taler-wallet-cli/src/integrationtests/sync.ts b/packages/taler-wallet-cli/src/harness/sync.ts index fccff715f..16be89eff 100644 --- a/packages/taler-wallet-cli/src/integrationtests/sync.ts +++ b/packages/taler-wallet-cli/src/harness/sync.ts @@ -24,7 +24,7 @@ import { GlobalTestState, pingProc, ProcessWrapper, -} from "./harness"; +} from "../harness/harness.js"; import { Configuration } from "@gnu-taler/taler-util"; const exec = util.promisify(require("child_process").exec); diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts index a5e129d92..142e98e7c 100644 --- a/packages/taler-wallet-cli/src/index.ts +++ b/packages/taler-wallet-cli/src/index.ts @@ -19,6 +19,7 @@ */ import os from "os"; import fs from "fs"; +import path from "path"; import { deepStrictEqual } from "assert"; // Polyfill for encoding which isn't present globally in older nodejs versions import { TextEncoder, TextDecoder } from "util"; @@ -56,6 +57,9 @@ import { Wallet, } from "@gnu-taler/taler-wallet-core"; import { lintExchangeDeployment } from "./lint.js"; +import { runBench1 } from "./bench1.js"; +import { runEnv1 } from "./env1.js"; +import { GlobalTestState, runTestWithState } from "./harness/harness.js"; // This module also serves as the entry point for the crypto // thread worker, and thus must expose these two handlers. @@ -635,6 +639,33 @@ const advancedCli = walletCli.subcommand("advancedArgs", "advanced", { }); advancedCli + .subcommand("bench1", "bench1", { + help: "Run the 'bench1' benchmark", + }) + .requiredOption("configJson", ["--config-json"], clk.STRING) + .action(async (args) => { + let config: any; + try { + config = JSON.parse(args.bench1.configJson); + } catch (e) { + console.log("Could not parse config JSON"); + } + await runBench1(config); + }); + +advancedCli + .subcommand("env1", "env1", { + help: "Run a test environment for bench1", + }) + .action(async (args) => { + const testDir = fs.mkdtempSync(path.join(os.tmpdir(), "taler-env1-")); + const testState = new GlobalTestState({ + testDir, + }); + await runTestWithState(testState, runEnv1, "env1", true); + }); + +advancedCli .subcommand("withdrawFakebank", "withdraw-fakebank", { help: "Withdraw via a fakebank.", }) @@ -642,7 +673,7 @@ advancedCli help: "Base URL of the exchange to use", }) .requiredOption("amount", ["--amount"], clk.STRING, { - help: "Amount to withdraw (before fees)." + help: "Amount to withdraw (before fees).", }) .requiredOption("bank", ["--bank"], clk.STRING, { help: "Base URL of the Taler fakebank service.", diff --git a/packages/taler-wallet-cli/src/integrationtests/scenario-prompt-payment.ts b/packages/taler-wallet-cli/src/integrationtests/scenario-prompt-payment.ts index e3c2af8e6..ea05de8e9 100644 --- a/packages/taler-wallet-cli/src/integrationtests/scenario-prompt-payment.ts +++ b/packages/taler-wallet-cli/src/integrationtests/scenario-prompt-payment.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; /** * Run test for basic, bank-integrated withdrawal. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-bank-api.ts b/packages/taler-wallet-cli/src/integrationtests/test-bank-api.ts index d6d0e2dce..0f8af05e5 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-bank-api.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-bank-api.ts @@ -27,9 +27,9 @@ import { BankApi, BankAccessApi, CreditDebitIndicator, -} from "./harness"; +} from "../harness/harness.js"; import { createEddsaKeyPair, encodeCrock } from "@gnu-taler/taler-util"; -import { defaultCoinConfig } from "./denomStructures"; +import { defaultCoinConfig } from "../harness/denomStructures"; /** * Run test for basic, bank-integrated withdrawal. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-claim-loop.ts b/packages/taler-wallet-cli/src/integrationtests/test-claim-loop.ts index 46882d5c4..a509e3b19 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-claim-loop.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-claim-loop.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; import { URL } from "url"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-denom-unoffered.ts b/packages/taler-wallet-cli/src/integrationtests/test-denom-unoffered.ts index 430a1ac93..28cca0758 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-denom-unoffered.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-denom-unoffered.ts @@ -27,8 +27,8 @@ import { WalletApiOperation, } from "@gnu-taler/taler-wallet-core"; import { makeEventId } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState, MerchantPrivateApi } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; export async function runDenomUnofferedTest(t: GlobalTestState) { // Set up test environment diff --git a/packages/taler-wallet-cli/src/integrationtests/test-deposit.ts b/packages/taler-wallet-cli/src/integrationtests/test-deposit.ts index 156661e46..f33c8338b 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-deposit.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-deposit.ts @@ -18,8 +18,8 @@ * Imports. */ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; /** * Run test for basic, bank-integrated withdrawal and payment. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts b/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts index 9cbdbd34c..8a5d563ce 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts @@ -26,7 +26,7 @@ import { MerchantService, BankApi, BankAccessApi, -} from "./harness"; +} from "../harness/harness.js"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { ExchangesListRespose, @@ -36,8 +36,8 @@ import { import { FaultInjectedExchangeService, FaultInjectionResponseContext, -} from "./faultInjection"; -import { defaultCoinConfig } from "./denomStructures"; +} from "../harness/faultInjection"; +import { defaultCoinConfig } from "../harness/denomStructures"; /** * Test if the wallet handles outdated exchange versions correct.y diff --git a/packages/taler-wallet-cli/src/integrationtests/test-exchange-timetravel.ts b/packages/taler-wallet-cli/src/integrationtests/test-exchange-timetravel.ts index 50065c0df..56684f70a 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-exchange-timetravel.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-exchange-timetravel.ts @@ -31,7 +31,7 @@ import { readSuccessResponseJsonOrThrow, WalletApiOperation, } from "@gnu-taler/taler-wallet-core"; -import { makeNoFeeCoinConfig } from "./denomStructures"; +import { makeNoFeeCoinConfig } from "../harness/denomStructures"; import { BankService, ExchangeService, @@ -40,8 +40,8 @@ import { MerchantService, setupDb, WalletCli, -} from "./harness"; -import { startWithdrawViaBank, withdrawViaBank } from "./helpers"; +} from "../harness/harness.js"; +import { startWithdrawViaBank, withdrawViaBank } from "../harness/helpers.js"; async function applyTimeTravel( timetravelDuration: Duration, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts b/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts index ae8cf0e17..025e12226 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-fee-regression.ts @@ -25,12 +25,12 @@ import { MerchantService, setupDb, WalletCli, -} from "./harness"; +} from "../harness/harness.js"; import { withdrawViaBank, makeTestPayment, SimpleTestEnvironment, -} from "./helpers"; +} from "../harness/helpers.js"; /** * Run a test case with a simple TESTKUDOS Taler environment, consisting diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankaccount.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankaccount.ts index 8e079caa4..839ad5fa7 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankaccount.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankaccount.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { NexusUserBundle, LibeufinNexusApi, @@ -25,7 +25,7 @@ import { LibeufinSandboxService, LibeufinSandboxApi, findNexusPayment, -} from "./libeufin"; +} from "../harness/libeufin"; /** * Run basic test with LibEuFin. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankconnection.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankconnection.ts index f8bee7f16..f1d507c03 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankconnection.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankconnection.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { NexusUserBundle, LibeufinNexusApi, @@ -25,7 +25,7 @@ import { LibeufinSandboxService, LibeufinSandboxApi, findNexusPayment, -} from "./libeufin"; +} from "../harness/libeufin"; /** * Run basic test with LibEuFin. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-facade-bad-request.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-facade-bad-request.ts index 1917c0c11..b106cf304 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-facade-bad-request.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-facade-bad-request.ts @@ -19,13 +19,13 @@ */ import axios from "axios"; import { URL } from "@gnu-taler/taler-util"; -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { SandboxUserBundle, NexusUserBundle, launchLibeufinServices, LibeufinNexusApi, -} from "./libeufin"; +} from "../harness/libeufin"; export async function runLibeufinApiFacadeBadRequestTest(t: GlobalTestState) { diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-facade.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-facade.ts index b0e569146..c49d49712 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-facade.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-facade.ts @@ -17,13 +17,13 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { SandboxUserBundle, NexusUserBundle, launchLibeufinServices, LibeufinNexusApi, -} from "./libeufin"; +} from "../harness/libeufin"; /** * Run basic test with LibEuFin. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-permissions.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-permissions.ts index abb843c94..e64f459a0 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-permissions.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-permissions.ts @@ -17,12 +17,12 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { NexusUserBundle, LibeufinNexusApi, LibeufinNexusService, -} from "./libeufin"; +} from "../harness/libeufin"; /** * Run basic test with LibEuFin. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-sandbox-camt.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-sandbox-camt.ts index ef8a1f2b5..f5df4cfa3 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-sandbox-camt.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-sandbox-camt.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { NexusUserBundle, LibeufinNexusApi, @@ -25,7 +25,7 @@ import { LibeufinSandboxService, LibeufinSandboxApi, findNexusPayment, -} from "./libeufin"; +} from "../harness/libeufin"; // This test only checks that LibEuFin doesn't fail when // it generates Camt statements - no assertions take place. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-sandbox-transactions.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-sandbox-transactions.ts index f9676c58c..a90644926 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-sandbox-transactions.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-sandbox-transactions.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { NexusUserBundle, LibeufinNexusApi, @@ -25,7 +25,7 @@ import { LibeufinSandboxService, LibeufinSandboxApi, findNexusPayment, -} from "./libeufin"; +} from "../harness/libeufin"; export async function runLibeufinApiSandboxTransactionsTest(t: GlobalTestState) { diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-scheduling.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-scheduling.ts index d543bc4ab..3863c5711 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-scheduling.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-scheduling.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { GlobalTestState, setupDb } from "./harness"; +import { GlobalTestState, setupDb } from "../harness/harness.js"; import { SandboxUserBundle, NexusUserBundle, @@ -25,7 +25,7 @@ import { LibeufinSandboxApi, LibeufinNexusApi, LibeufinNexusService, -} from "./libeufin"; +} from "../harness/libeufin"; /** * Test Nexus scheduling API. It creates a task, check whether it shows @@ -72,7 +72,7 @@ export async function runLibeufinApiSchedulingTest(t: GlobalTestState) { user01nexus.localAccountName, "test-task", ); - } catch (err) { + } catch (err: any) { t.assertTrue(err.response.status == 404); } @@ -100,7 +100,7 @@ export async function runLibeufinApiSchedulingTest(t: GlobalTestState) { user01nexus.localAccountName, "test-task", ); - } catch (err) { + } catch (err: any) { t.assertTrue(err.response.status == 404); } } diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-users.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-users.ts index b53db4212..edf66690b 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-users.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-users.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; -import { LibeufinNexusApi, LibeufinNexusService } from "./libeufin"; +import { GlobalTestState } from "../harness/harness.js"; +import { LibeufinNexusApi, LibeufinNexusService } from "../harness/libeufin"; /** * Run basic test with LibEuFin. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-bad-gateway.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-bad-gateway.ts index 3da5850cf..786e61832 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-bad-gateway.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-bad-gateway.ts @@ -17,13 +17,13 @@ /** * Imports. */ -import { GlobalTestState, delayMs } from "./harness"; +import { GlobalTestState, delayMs } from "../harness/harness.js"; import { NexusUserBundle, LibeufinNexusApi, LibeufinNexusService, LibeufinSandboxService, -} from "./libeufin"; +} from "../harness/libeufin"; /** * Testing how Nexus reacts when the Sandbox is unreachable. @@ -65,7 +65,7 @@ export async function runLibeufinBadGatewayTest(t: GlobalTestState) { libeufinNexus, user01nexus.connReq.name, ); - } catch(e) { + } catch(e: any) { t.assertTrue(e.response.status == 502); return; } diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts index b284d7299..9e1842d03 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts @@ -19,7 +19,7 @@ */ import { CoreApiResponse } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { CoinConfig, defaultCoinConfig } from "./denomStructures"; +import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures"; import { DbInfo, HarnessExchangeBankAccount, @@ -28,14 +28,14 @@ import { MerchantService, setupDb, WalletCli, -} from "./harness"; -import { makeTestPayment } from "./helpers"; +} from "../harness/harness.js"; +import { makeTestPayment } from "../harness/helpers.js"; import { LibeufinNexusApi, LibeufinNexusService, LibeufinSandboxApi, LibeufinSandboxService, -} from "./libeufin"; +} from "../harness/libeufin"; const exchangeIban = "DE71500105179674997361"; const customerIban = "DE84500105176881385584"; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts index e45f0a239..5a995fb69 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts @@ -17,14 +17,14 @@ /** * Imports. */ -import { GlobalTestState, delayMs } from "./harness"; +import { GlobalTestState, delayMs } from "../harness/harness.js"; import { SandboxUserBundle, NexusUserBundle, launchLibeufinServices, LibeufinSandboxApi, LibeufinNexusApi, -} from "./libeufin"; +} from "../harness/libeufin"; /** * This test checks how the C52 and C53 coordinate. It'll test diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts index 143870128..0bbd4fd28 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts @@ -17,14 +17,14 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { SandboxUserBundle, NexusUserBundle, launchLibeufinServices, LibeufinNexusApi, LibeufinSandboxApi, -} from "./libeufin"; +} from "../harness/libeufin"; /** * Testing the Anastasis API, offered by the Anastasis facade. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-keyrotation.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-keyrotation.ts index 8e527804c..5dc31f0bf 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-keyrotation.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-keyrotation.ts @@ -17,14 +17,14 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { SandboxUserBundle, NexusUserBundle, launchLibeufinServices, LibeufinSandboxApi, LibeufinNexusApi, -} from "./libeufin"; +} from "../harness/libeufin"; /** * Run basic test with LibEuFin. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-nexus-balance.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-nexus-balance.ts index c00a102d3..23d76081f 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-nexus-balance.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-nexus-balance.ts @@ -17,14 +17,14 @@ /** * Imports. */ -import { GlobalTestState, delayMs } from "./harness"; +import { GlobalTestState, delayMs } from "../harness/harness.js"; import { SandboxUserBundle, NexusUserBundle, launchLibeufinServices, LibeufinSandboxApi, LibeufinNexusApi, -} from "./libeufin"; +} from "../harness/libeufin"; /** * This test checks how the C52 and C53 coordinate. It'll test diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts index 234a7bae8..39517f247 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund-multiple-users.ts @@ -17,14 +17,14 @@ /** * Imports. */ -import { GlobalTestState, delayMs } from "./harness"; +import { GlobalTestState, delayMs } from "../harness/harness.js"; import { SandboxUserBundle, NexusUserBundle, launchLibeufinServices, LibeufinSandboxApi, LibeufinNexusApi, -} from "./libeufin"; +} from "../harness/libeufin"; /** * User 01 expects a refund from user 02, and expectedly user 03 diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts index 5d5370d02..d91ae88bb 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts @@ -17,14 +17,14 @@ /** * Imports. */ -import { GlobalTestState, delayMs } from "./harness"; +import { GlobalTestState, delayMs } from "../harness/harness.js"; import { SandboxUserBundle, NexusUserBundle, launchLibeufinServices, LibeufinSandboxApi, LibeufinNexusApi, -} from "./libeufin"; +} from "../harness/libeufin"; /** * Run basic test with LibEuFin. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-sandbox-wire-transfer-cli.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-sandbox-wire-transfer-cli.ts index 503468990..5560f091a 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-sandbox-wire-transfer-cli.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-sandbox-wire-transfer-cli.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { NexusUserBundle, LibeufinNexusApi, @@ -25,7 +25,7 @@ import { LibeufinSandboxService, LibeufinSandboxApi, findNexusPayment, -} from "./libeufin"; +} from "../harness/libeufin"; export async function runLibeufinSandboxWireTransferCliTest(t: GlobalTestState) { diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts index eee1b8935..71a1e8c4b 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts @@ -17,12 +17,12 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { LibeufinNexusService, LibeufinSandboxService, LibeufinCli, -} from "./libeufin"; +} from "../harness/libeufin"; /** * Run basic test with LibEuFin. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts index 4cf9c39b4..8e8f966b9 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts @@ -25,12 +25,12 @@ import { MerchantService, setupDb, WalletCli, -} from "./harness"; +} from "../harness/harness.js"; import { withdrawViaBank, createFaultInjectedMerchantTestkudosEnvironment, FaultyMerchantTestEnvironment, -} from "./helpers"; +} from "../harness/helpers.js"; import { PreparePayResultType, codecForMerchantOrderStatusUnpaid, @@ -41,8 +41,8 @@ import { FaultInjectedExchangeService, FaultInjectedMerchantService, FaultInjectionRequestContext, -} from "./faultInjection"; -import { defaultCoinConfig } from "./denomStructures"; +} from "../harness/faultInjection"; +import { defaultCoinConfig } from "../harness/denomStructures"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { URL } from "url"; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts index 28f729692..589c79120 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts @@ -25,7 +25,7 @@ import { MerchantApiClient, MerchantService, setupDb, -} from "./harness"; +} from "../harness/harness.js"; /** * Test instance deletion and authentication for it diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-urls.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-urls.ts index c2f7c5179..fc5e7305a 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-urls.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-urls.ts @@ -24,7 +24,7 @@ import { MerchantApiClient, MerchantService, setupDb, -} from "./harness"; +} from "../harness/harness.js"; /** * Do basic checks on instance management and authentication. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts index da45b4661..46af87922 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts @@ -25,7 +25,7 @@ import { MerchantApiClient, MerchantService, setupDb, -} from "./harness"; +} from "../harness/harness.js"; /** * Do basic checks on instance management and authentication. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-longpolling.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-longpolling.ts index 6516327c2..556d9074e 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-longpolling.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-longpolling.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; import { PreparePayResultType, codecForMerchantOrderStatusUnpaid, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-refund-api.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-refund-api.ts index dc7863874..466b1efbd 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-refund-api.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-refund-api.ts @@ -24,8 +24,8 @@ import { MerchantServiceInterface, WalletCli, ExchangeServiceInterface, -} from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +} from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; import { URL, durationFromSpec, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-spec-public-orders.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-spec-public-orders.ts index 867af99d5..70edaaf0c 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-spec-public-orders.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-spec-public-orders.ts @@ -32,11 +32,11 @@ import { MerchantPrivateApi, MerchantService, WalletCli, -} from "./harness"; +} from "../harness/harness.js"; import { createSimpleTestkudosEnvironment, withdrawViaBank, -} from "./helpers.js"; +} from "../harness/helpers.js"; const httpLib = new NodeHttpLib(); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts b/packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts index 709ad1061..0fa9ec81d 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts @@ -27,12 +27,12 @@ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { FaultInjectionRequestContext, FaultInjectionResponseContext, -} from "./faultInjection"; -import { GlobalTestState, MerchantPrivateApi, setupDb } from "./harness"; +} from "../harness/faultInjection"; +import { GlobalTestState, MerchantPrivateApi, setupDb } from "../harness/harness.js"; import { createFaultInjectedMerchantTestkudosEnvironment, withdrawViaBank, -} from "./helpers"; +} from "../harness/helpers.js"; /** * Run test for basic, bank-integrated withdrawal. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-pay-paid.ts b/packages/taler-wallet-cli/src/integrationtests/test-pay-paid.ts index 64645dce2..2d291ddd3 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-pay-paid.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-pay-paid.ts @@ -17,11 +17,11 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "./harness"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; import { withdrawViaBank, createFaultInjectedMerchantTestkudosEnvironment, -} from "./helpers"; +} from "../harness/helpers.js"; import { PreparePayResultType, codecForMerchantOrderStatusUnpaid, @@ -29,7 +29,7 @@ import { URL, } from "@gnu-taler/taler-util"; import axios from "axios"; -import { FaultInjectionRequestContext } from "./faultInjection"; +import { FaultInjectionRequestContext } from "../harness/faultInjection"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; /** diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-claim.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-claim.ts index 9620db6d5..ba3bd8e0a 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-claim.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-claim.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi, WalletCli } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState, MerchantPrivateApi, WalletCli } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; import { PreparePayResultType } from "@gnu-taler/taler-util"; import { TalerErrorCode } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts index 57ad6a4ff..2be01d919 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts @@ -31,14 +31,14 @@ import { MerchantPrivateApi, BankApi, BankAccessApi, -} from "./harness"; +} from "../harness/harness.js"; import { FaultInjectedExchangeService, FaultInjectionRequestContext, FaultInjectionResponseContext, -} from "./faultInjection"; +} from "../harness/faultInjection"; import { CoreApiResponse } from "@gnu-taler/taler-util"; -import { defaultCoinConfig } from "./denomStructures"; +import { defaultCoinConfig } from "../harness/denomStructures"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; /** diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-forgettable.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-forgettable.ts index 49ffadc93..3bdd6bef3 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-forgettable.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-forgettable.ts @@ -17,12 +17,12 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { createSimpleTestkudosEnvironment, withdrawViaBank, makeTestPayment, -} from "./helpers"; +} from "../harness/helpers.js"; /** * Run test for payment with a contract that has forgettable fields. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-idempotency.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-idempotency.ts index 58c951b68..9378465a0 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-idempotency.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-idempotency.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; import { PreparePayResultType } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-multiple.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-multiple.ts index f545d5861..754c3a0e8 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-multiple.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-multiple.ts @@ -25,9 +25,9 @@ import { MerchantService, WalletCli, MerchantPrivateApi, -} from "./harness"; -import { withdrawViaBank } from "./helpers"; -import { coin_ct10, coin_u1 } from "./denomStructures"; +} from "../harness/harness.js"; +import { withdrawViaBank } from "../harness/helpers.js"; +import { coin_ct10, coin_u1 } from "../harness/denomStructures"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; async function setupTest( diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-on-demo.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-on-demo.ts index 0dabc9ca5..1d419fd9a 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-on-demo.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-on-demo.ts @@ -22,10 +22,10 @@ import { BankApi, WalletCli, BankAccessApi -} from "./harness"; +} from "../harness/harness.js"; import { makeTestPayment, -} from "./helpers"; +} from "../harness/helpers.js"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; /** diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-transient.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-transient.ts index b171ff66a..75d44d495 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-transient.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-transient.ts @@ -17,16 +17,16 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "./harness"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; import { withdrawViaBank, createFaultInjectedMerchantTestkudosEnvironment, -} from "./helpers"; +} from "../harness/helpers.js"; import axios from "axios"; import { FaultInjectionRequestContext, FaultInjectionResponseContext, -} from "./faultInjection"; +} from "../harness/faultInjection"; import { codecForMerchantOrderStatusUnpaid, ConfirmPayResultType, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-zero.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-zero.ts index 771ca27e8..c38b8b382 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-zero.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-zero.ts @@ -18,12 +18,12 @@ * Imports. */ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { createSimpleTestkudosEnvironment, withdrawViaBank, makeTestPayment, -} from "./helpers"; +} from "../harness/helpers.js"; /** * Run test for a payment for a "free" order with diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment.ts index 3512ff046..967d491be 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment.ts @@ -17,12 +17,12 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { createSimpleTestkudosEnvironment, withdrawViaBank, makeTestPayment, -} from "./helpers"; +} from "../harness/helpers.js"; /** * Run test for basic, bank-integrated withdrawal and payment. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts b/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts index 04eee79e3..a8e3b3e95 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; import { PreparePayResultType, codecForMerchantOrderStatusUnpaid, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-refund-auto.ts b/packages/taler-wallet-cli/src/integrationtests/test-refund-auto.ts index f1e79f4b9..230fc942d 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-refund-auto.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-refund-auto.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; import { durationFromSpec } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-refund-gone.ts b/packages/taler-wallet-cli/src/integrationtests/test-refund-gone.ts index b4276248e..acb74b3d3 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-refund-gone.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-refund-gone.ts @@ -17,12 +17,12 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "./harness"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; import { createSimpleTestkudosEnvironment, withdrawViaBank, applyTimeTravel, -} from "./helpers"; +} from "../harness/helpers.js"; import { durationFromSpec, timestampAddDuration, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-refund-incremental.ts b/packages/taler-wallet-cli/src/integrationtests/test-refund-incremental.ts index 11e1226d1..47c2293e2 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-refund-incremental.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-refund-incremental.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState, delayMs, MerchantPrivateApi } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState, delayMs, MerchantPrivateApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; import { TransactionType, Amounts, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-refund.ts b/packages/taler-wallet-cli/src/integrationtests/test-refund.ts index 1808f7d73..f11771922 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-refund.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-refund.ts @@ -19,8 +19,8 @@ */ import { durationFromSpec } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState, MerchantPrivateApi } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; /** * Run test for basic, bank-integrated withdrawal. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts b/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts index fc1ffb267..276c532b5 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-revocation.ts @@ -18,7 +18,7 @@ * Imports. */ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { CoinConfig } from "./denomStructures"; +import { CoinConfig } from "../harness/denomStructures"; import { GlobalTestState, ExchangeService, @@ -27,12 +27,12 @@ import { setupDb, BankService, delayMs, -} from "./harness"; +} from "../harness/harness.js"; import { withdrawViaBank, makeTestPayment, SimpleTestEnvironment, -} from "./helpers"; +} from "../harness/helpers.js"; async function revokeAllWalletCoins(req: { wallet: WalletCli; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-timetravel-autorefresh.ts b/packages/taler-wallet-cli/src/integrationtests/test-timetravel-autorefresh.ts index bad821198..e20d8bdad 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-timetravel-autorefresh.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-timetravel-autorefresh.ts @@ -27,7 +27,7 @@ import { PendingOperationsResponse, WalletApiOperation, } from "@gnu-taler/taler-wallet-core"; -import { makeNoFeeCoinConfig } from "./denomStructures"; +import { makeNoFeeCoinConfig } from "../harness/denomStructures"; import { BankService, ExchangeService, @@ -36,8 +36,8 @@ import { MerchantService, setupDb, WalletCli, -} from "./harness"; -import { startWithdrawViaBank, withdrawViaBank } from "./helpers"; +} from "../harness/harness.js"; +import { startWithdrawViaBank, withdrawViaBank } from "../harness/helpers.js"; async function applyTimeTravel( timetravelDuration: Duration, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-timetravel-withdraw.ts b/packages/taler-wallet-cli/src/integrationtests/test-timetravel-withdraw.ts index b9e45c862..2ff857057 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-timetravel-withdraw.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-timetravel-withdraw.ts @@ -17,12 +17,12 @@ /** * Imports. */ -import { GlobalTestState } from "./harness"; +import { GlobalTestState } from "../harness/harness.js"; import { createSimpleTestkudosEnvironment, withdrawViaBank, startWithdrawViaBank, -} from "./helpers"; +} from "../harness/helpers.js"; import { Duration, TransactionType } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts b/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts index 2421b462f..c6a7f8402 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-tipping.ts @@ -18,8 +18,8 @@ * Imports. */ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState, MerchantPrivateApi, BankApi } from "./harness"; -import { createSimpleTestkudosEnvironment } from "./helpers"; +import { GlobalTestState, MerchantPrivateApi, BankApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment } from "../harness/helpers.js"; /** * Run test for basic, bank-integrated withdrawal. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-wallet-backup-basic.ts b/packages/taler-wallet-cli/src/integrationtests/test-wallet-backup-basic.ts index 7debfe6b6..23e01e5e1 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-wallet-backup-basic.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-wallet-backup-basic.ts @@ -18,9 +18,9 @@ * Imports. */ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState, WalletCli } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; -import { SyncService } from "./sync"; +import { GlobalTestState, WalletCli } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js"; +import { SyncService } from "../harness/sync"; /** * Run test for basic, bank-integrated withdrawal. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-wallet-backup-doublespend.ts b/packages/taler-wallet-cli/src/integrationtests/test-wallet-backup-doublespend.ts index ab2687fc3..8c20dcc2b 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-wallet-backup-doublespend.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-wallet-backup-doublespend.ts @@ -19,13 +19,13 @@ */ import { PreparePayResultType } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState, WalletCli, MerchantPrivateApi } from "./harness"; +import { GlobalTestState, WalletCli, MerchantPrivateApi } from "../harness/harness.js"; import { createSimpleTestkudosEnvironment, makeTestPayment, withdrawViaBank, -} from "./helpers"; -import { SyncService } from "./sync"; +} from "../harness/helpers.js"; +import { SyncService } from "../harness/sync"; /** * Run test for basic, bank-integrated withdrawal. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-wallettesting.ts b/packages/taler-wallet-cli/src/integrationtests/test-wallettesting.ts index 2499e65a0..c21a7279b 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-wallettesting.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-wallettesting.ts @@ -24,7 +24,7 @@ */ import { Amounts } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { CoinConfig, defaultCoinConfig } from "./denomStructures.js"; +import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js"; import { BankService, ExchangeService, @@ -32,8 +32,8 @@ import { MerchantService, setupDb, WalletCli, -} from "./harness.js"; -import { SimpleTestEnvironment } from "./helpers.js"; +} from "../harness/harness.js"; +import { SimpleTestEnvironment } from "../harness/helpers.js"; const merchantAuthToken = "secret-token:sandbox"; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts index 896b1e877..fe719ea62 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts @@ -19,8 +19,8 @@ */ import { TalerErrorCode } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState, BankApi, BankAccessApi } from "./harness"; -import { createSimpleTestkudosEnvironment } from "./helpers"; +import { GlobalTestState, BankApi, BankAccessApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment } from "../harness/helpers.js"; /** * Run test for basic, bank-integrated withdrawal. diff --git a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts index 4a02b2708..35969c78f 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-bank-integrated.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState, BankApi, BankAccessApi } from "./harness"; -import { createSimpleTestkudosEnvironment } from "./helpers"; +import { GlobalTestState, BankApi, BankAccessApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment } from "../harness/helpers.js"; import { codecForBalancesResponse } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; diff --git a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-fakebank.ts b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-fakebank.ts index bfe29b322..97beba1bf 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-fakebank.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-fakebank.ts @@ -24,10 +24,10 @@ import { setupDb, ExchangeService, FakeBankService, -} from "./harness"; -import { createSimpleTestkudosEnvironment } from "./helpers"; +} from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment } from "../harness/helpers.js"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { CoinConfig, defaultCoinConfig } from "./denomStructures.js"; +import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js"; import { URL } from "@gnu-taler/taler-util"; /** diff --git a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-manual.ts b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-manual.ts index fe8fd3c56..b93d1b500 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-manual.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-manual.ts @@ -17,8 +17,8 @@ /** * Imports. */ -import { GlobalTestState, BankApi } from "./harness"; -import { createSimpleTestkudosEnvironment } from "./helpers"; +import { GlobalTestState, BankApi } from "../harness/harness.js"; +import { createSimpleTestkudosEnvironment } from "../harness/helpers.js"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; /** diff --git a/packages/taler-wallet-cli/src/integrationtests/testrunner.ts b/packages/taler-wallet-cli/src/integrationtests/testrunner.ts index bcb0dd271..d985ed67f 100644 --- a/packages/taler-wallet-cli/src/integrationtests/testrunner.ts +++ b/packages/taler-wallet-cli/src/integrationtests/testrunner.ts @@ -22,7 +22,7 @@ import { runTestWithState, shouldLingerInTest, TestRunResult, -} from "./harness"; +} from "../harness/harness.js"; import { runPaymentTest } from "./test-payment"; import { runPaymentDemoTest } from "./test-payment-on-demo"; import * as fs from "fs"; diff --git a/packages/taler-wallet-cli/src/lint.ts b/packages/taler-wallet-cli/src/lint.ts index 0fed68c34..2b888ccf4 100644 --- a/packages/taler-wallet-cli/src/lint.ts +++ b/packages/taler-wallet-cli/src/lint.ts @@ -43,7 +43,7 @@ import { } from "@gnu-taler/taler-wallet-core"; import { URL } from "url"; import { spawn } from "child_process"; -import { delayMs } from "./integrationtests/harness.js"; +import { delayMs } from "./harness/harness.js"; interface BasicConf { mainCurrency: string; diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts index c5bf2c8c0..991c03ee2 100644 --- a/packages/taler-wallet-core/src/wallet-api-types.ts +++ b/packages/taler-wallet-core/src/wallet-api-types.ts @@ -118,6 +118,10 @@ export enum WalletApiOperation { } export type WalletOperations = { + [WalletApiOperation.InitWallet]: { + request: {}; + response: {}; + }; [WalletApiOperation.WithdrawFakebank]: { request: WithdrawFakebankRequest; response: {}; |