taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 4c550543221e75f9cb59074bef72f4644f8a42e0
parent 6f60e390424dfcb92b5cafaa06ff976463cd4bbf
Author: Iván Ávalos <avalos@disroot.org>
Date:   Thu, 29 Jan 2026 16:00:22 +0100

add testingGetPerformanceStats to CLI under 'advanced'

Diffstat:
Mpackages/taler-wallet-cli/src/index.ts | 17+++++++++++++++++
Mpackages/taler-wallet-core/src/remote.ts | 6+++---
2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts @@ -1518,6 +1518,23 @@ advancedCli }); advancedCli + .subcommand("performanceStats", "performance-stats", { + help: "Print performance stats.", +}) + .maybeOption("limit", ["--limit"], clk.INT, { + help: "Limit each table to n entries.", + }) + .action(async (args) => { + await withWallet(args, { lazyTaskLoop: true}, async (wallet) => { + const statsResp = await wallet.client.call( + WalletApiOperation.TestingGetPerformanceStats, + { limit: args.performanceStats.limit }, + ); + console.log(j2s(statsResp)); + }); + }); + +advancedCli .subcommand("genReserve", "gen-reserve", { help: "Generate a reserve key pair (not stored in the DB).", }) diff --git a/packages/taler-wallet-core/src/remote.ts b/packages/taler-wallet-core/src/remote.ts @@ -17,6 +17,8 @@ import { CoreApiRequestEnvelope, CoreApiResponse, + encodeCrock, + getRandomBytes, Logger, OpenedPromise, openPromise, @@ -52,7 +54,6 @@ export interface RemoteWalletConnectArgs { export async function createRemoteWallet( args: RemoteWalletConnectArgs, ): Promise<RemoteWallet> { - let nextRequestId = 1; let requestMap: Map< string, { @@ -65,8 +66,7 @@ export async function createRemoteWallet( onEstablished(connection) { const ctx: RemoteWallet = { makeCoreApiRequest(operation, payload) { - const id = `req-${nextRequestId}`; - nextRequestId += 1; + let id = `req-${encodeCrock(getRandomBytes(32))}`; const req: CoreApiRequestEnvelope = { operation, id,