From 277a5c641df336d8b5b2d9bd6559e45f0b02aa79 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 29 Feb 2024 18:37:13 +0100 Subject: wallet-core: improve config handling, test builtin exchange config --- packages/taler-wallet-core/src/host-impl.node.ts | 30 ++++++++++++++---------- 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'packages/taler-wallet-core/src/host-impl.node.ts') diff --git a/packages/taler-wallet-core/src/host-impl.node.ts b/packages/taler-wallet-core/src/host-impl.node.ts index a0c739f45..6a32a086a 100644 --- a/packages/taler-wallet-core/src/host-impl.node.ts +++ b/packages/taler-wallet-core/src/host-impl.node.ts @@ -32,7 +32,11 @@ import { shimIndexedDB, } from "@gnu-taler/idb-bridge"; import { createNodeSqlite3Impl } from "@gnu-taler/idb-bridge/node-sqlite3-bindings"; -import { Logger, SetTimeoutTimerAPI } from "@gnu-taler/taler-util"; +import { + Logger, + SetTimeoutTimerAPI, + WalletRunConfig, +} from "@gnu-taler/taler-util"; import { createPlatformHttpLib } from "@gnu-taler/taler-util/http"; import * as fs from "fs"; import { NodeThreadCryptoWorkerFactory } from "./crypto/workers/nodeThreadWorker.js"; @@ -133,15 +137,18 @@ export async function createNativeWalletHost2( wallet: Wallet; getDbStats: () => AccessStats; }> { - let myHttpLib; - if (args.httpLib) { - myHttpLib = args.httpLib; - } else { - myHttpLib = createPlatformHttpLib({ - enableThrottling: true, - requireTls: !args.config?.features?.allowHttp, - }); - } + const myHttpFactory = (config: WalletRunConfig) => { + let myHttpLib; + if (args.httpLib) { + myHttpLib = args.httpLib; + } else { + myHttpLib = createPlatformHttpLib({ + enableThrottling: true, + requireTls: !config.features.allowHttp, + }); + } + return myHttpLib; + }; let dbResp: MakeDbResult; @@ -188,10 +195,9 @@ export async function createNativeWalletHost2( const w = await Wallet.create( myIdbFactory, - myHttpLib, + myHttpFactory, timer, workerFactory, - args.config, ); if (args.notifyHandler) { -- cgit v1.2.3