diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-08-18 19:42:21 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-08-18 19:42:21 +0200 |
commit | 1e9e915085cde817125d8cd0c9961b9252a05751 (patch) | |
tree | e0df685a058f242a7e9d289f8e5c9524e492b97e /src/headless/taler-wallet-cli.ts | |
parent | ddd377c82ed74f708f899580770c99d9c8bd891f (diff) | |
download | wallet-core-1e9e915085cde817125d8cd0c9961b9252a05751.tar.xz |
bump version / implement integrationtest cmd
Diffstat (limited to 'src/headless/taler-wallet-cli.ts')
-rw-r--r-- | src/headless/taler-wallet-cli.ts | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts index 9c4a84e3e..6e2190236 100644 --- a/src/headless/taler-wallet-cli.ts +++ b/src/headless/taler-wallet-cli.ts @@ -17,6 +17,8 @@ import commander = require("commander"); import os = require("os"); import { getDefaultNodeWallet, withdrawTestBalance } from "./helpers"; +import { MerchantBackendConnection } from "./merchant"; +import { runIntegrationTest } from "./integrationtest"; const program = new commander.Command(); program.version("0.0.1"); @@ -36,7 +38,7 @@ program }); program - .command("balance", undefined, { isDefault: true }) + .command("balance") .description("show wallet balance") .action(async () => { console.log("balance command called"); @@ -49,6 +51,35 @@ program process.exit(0); }); + +program + .command("integrationtest") + .option('-e, --exchange <exchange-url>', 'exchange base URL', "https://exchange.test.taler.net/") + .option('-m, --merchant <merchant-url>', 'merchant base URL', "https://backend.test.taler.net/") + .option('-m, --merchant-instance <merchant-instance>', 'merchant instance', "default") + .option('-m, --merchant-api-key <merchant-api-key>', 'merchant API key', "sandbox") + .option('-b, --bank <bank-url>', 'bank base URL', "https://bank.test.taler.net/") + .option('-w, --withdraw-amount <withdraw-amt>', 'amount to withdraw', "TESTKUDOS:10") + .option('-s, --spend-amount <spend-amt>', 'amount to spend', "TESTKUDOS:5") + .description("Run integration test with bank, exchange and merchant.") + .action(async (cmdObj) => { + + await runIntegrationTest({ + amountToSpend: cmdObj.spendAmount, + amountToWithdraw: cmdObj.withdrawAmount, + bankBaseUrl: cmdObj.bank, + exchangeBaseUrl: cmdObj.exchange, + merchantApiKey: cmdObj.merchantApiKey, + merchantBaseUrl: cmdObj.merchant, + merchantInstance: cmdObj.merchantInstance, + }).catch(err => { + console.error("Failed with exception:"); + console.error(err); + }); + + process.exit(0); + }); + // error on unknown commands program.on("command:*", function() { console.error( |