diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-14 15:53:50 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-14 15:53:50 +0530 |
commit | 953cd9dc41ff3d52d23fe77f4ba3c18281e9d58f (patch) | |
tree | 17ff47fea3651dad192beee5d32c5fd4c538fa39 /packages/taler-wallet-core/src/wallet.ts | |
parent | e3850158c249d890399fdb9e083ec7e654a8380f (diff) | |
download | wallet-core-953cd9dc41ff3d52d23fe77f4ba3c18281e9d58f.tar.xz |
nuke some console.log statements, test wallet testing functionality in integration test
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 0b3e2ed60..4b309dde3 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -86,6 +86,10 @@ import { CoreApiResponse, codecForPreparePayRequest, codecForIntegrationTestArgs, + WithdrawTestBalanceRequest, + withdrawTestBalanceDefaults, + codecForWithdrawTestBalance, + codecForTestPayArgs, } from "./types/walletTypes"; import { Logger } from "./util/logging"; @@ -313,7 +317,7 @@ export class Wallet { } }); this.runRetryLoop().catch((e) => { - console.log("exception in wallet retry loop"); + logger.error("exception in wallet retry loop"); reject(e); }); }); @@ -377,7 +381,7 @@ export class Wallet { numPending, }); await Promise.race([timeout, this.latch.wait()]); - console.log("timeout done"); + logger.trace("timeout done"); } else { // FIXME: maybe be a bit smarter about executing these // operations in parallel? @@ -899,11 +903,9 @@ export class Wallet { } async withdrawTestBalance( - amount = "TESTKUDOS:10", - bankBaseUrl = "https://bank.test.taler.net/", - exchangeBaseUrl = "https://exchange.test.taler.net/", + req: WithdrawTestBalanceRequest, ): Promise<void> { - await withdrawTestBalance(this.ws, amount, bankBaseUrl, exchangeBaseUrl); + await withdrawTestBalance(this.ws, req.amount, req.bankBaseUrl, req.exchangeBaseUrl); } async runIntegrationtest(args: IntegrationTestArgs): Promise<void> { @@ -924,7 +926,16 @@ export class Wallet { ): Promise<Record<string, any>> { switch (operation) { case "withdrawTestkudos": { - await this.withdrawTestBalance(); + await this.withdrawTestBalance({ + amount: "TESTKUDOS:10", + bankBaseUrl: "https://bank.test.taler.net/", + exchangeBaseUrl: "https://exchange.test.taler.net/", + }); + return {}; + } + case "withdrawTestBalance": { + const req = codecForWithdrawTestBalance().decode(payload); + await this.withdrawTestBalance(req); return {}; } case "runIntegrationtest": { @@ -933,8 +944,8 @@ export class Wallet { return {} } case "testPay": { - const req = codecForIntegrationTestArgs().decode(payload); - await this.runIntegrationtest(req); + const req = codecForTestPayArgs().decode(payload); + await this.testPay(req); return {} } case "getTransactions": { |