put 'setInsecureTrustExchange' behind env variable in benchmark

This commit is contained in:
Florian Dold 2021-12-09 12:00:10 +01:00
parent dbfc599540
commit 423af144ee
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 11 additions and 2 deletions

View File

@ -56,6 +56,13 @@ export async function runBench1(configJson: any): Promise<void> {
`Starting Benchmark iterations=${numIter} deposits=${numDeposits}`,
);
const trustExchange = !!process.env["TALER_WALLET_INSECURE_TRUST_EXCHANGE"];
if (trustExchange) {
logger.info("trusting exchange (not validating signatures)");
} else {
logger.info("not trusting exchange (validating signatures)");
}
let wallet = {} as Wallet;
for (let i = 0; i < numIter; i++) {
@ -71,7 +78,9 @@ export async function runBench1(configJson: any): Promise<void> {
persistentStoragePath: undefined,
httpLib: myHttpLib,
});
wallet.setInsecureTrustExchange();
if (trustExchange) {
wallet.setInsecureTrustExchange();
}
await wallet.client.call(WalletApiOperation.InitWallet, {});
}

View File

@ -25,7 +25,7 @@ import { CryptoWorker } from "./cryptoWorkerInterface.js";
import child_process from "child_process";
import type internal from "stream";
import { OpenedPromise, openPromise } from "../../index.js";
import { Logger } from "@gnu-taler/taler-util";
import { j2s, Logger } from "@gnu-taler/taler-util";
const logger = new Logger("synchronousWorker.ts");