From fb23bab6fe38f2e8d71ca51d8210b403d2514e3a Mon Sep 17 00:00:00 2001 From: Boss Marco Date: Tue, 26 Oct 2021 10:50:01 +0200 Subject: update bench1 config --- packages/taler-wallet-cli/src/bench1.ts | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'packages/taler-wallet-cli/src/bench1.ts') diff --git a/packages/taler-wallet-cli/src/bench1.ts b/packages/taler-wallet-cli/src/bench1.ts index 4a2651f36..1d836365d 100644 --- a/packages/taler-wallet-cli/src/bench1.ts +++ b/packages/taler-wallet-cli/src/bench1.ts @@ -48,10 +48,13 @@ export async function runBench1(configJson: any): Promise { await wallet.client.call(WalletApiOperation.InitWallet, {}); const numIter = b1conf.iterations ?? 1; + const numDeposits = b1conf.deposits ?? 5; + + const withdrawAmount = (numDeposits + 1) * 10; for (let i = 0; i < numIter; i++) { await wallet.client.call(WalletApiOperation.WithdrawFakebank, { - amount: "TESTKUDOS:10", + amount: b1conf.currency + ":" + string(withdrawAmount), bank: b1conf.bank, exchange: b1conf.exchange, }); @@ -60,14 +63,16 @@ export async function runBench1(configJson: any): Promise { stopWhenDone: true, }); - await wallet.client.call(WalletApiOperation.CreateDepositGroup, { - amount: "TESTKUDOS:5", - depositPaytoUri: "payto://x-taler-bank/localhost/foo", - }); + for (let i = 0; i < numDeposits; i++) { + await wallet.client.call(WalletApiOperation.CreateDepositGroup, { + amount: b1conf.currency + ":10", + depositPaytoUri: b1conf.payto, + }); - await wallet.runTaskLoop({ - stopWhenDone: true, - }); + await wallet.runTaskLoop({ + stopWhenDone: true, + }); + } } wallet.stop(); @@ -82,6 +87,11 @@ interface Bench1Config { */ bank: string; + /** + * Payto url for deposits. + */ + payto: string; + /** * Base URL of the exchange. */ @@ -92,6 +102,10 @@ interface Bench1Config { * Defaults to 1. */ iterations?: number; + + currency: string; + + deposits?: number; } /** @@ -100,6 +114,9 @@ interface Bench1Config { const codecForBench1Config = () => buildCodecForObject() .property("bank", codecForString()) + .property("payto", codecForString()) .property("exchange", codecForString()) .property("iterations", codecOptional(codecForNumber())) + .property("deposits", codecOptional(codecForNumber())) + .property("currency", codecForString()) .build("Bench1Config"); -- cgit v1.2.3