summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/host-impl.node.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-29 18:37:13 +0100
committerFlorian Dold <florian@dold.me>2024-02-29 23:24:06 +0100
commit277a5c641df336d8b5b2d9bd6559e45f0b02aa79 (patch)
tree49cbdadaf04b5630cdae3e2a89e6d3a74d30632b /packages/taler-wallet-core/src/host-impl.node.ts
parent206780bb0ee763bcf50a3f4f9f78579a8adcdb3a (diff)
downloadwallet-core-277a5c641df336d8b5b2d9bd6559e45f0b02aa79.tar.gz
wallet-core-277a5c641df336d8b5b2d9bd6559e45f0b02aa79.tar.bz2
wallet-core-277a5c641df336d8b5b2d9bd6559e45f0b02aa79.zip
wallet-core: improve config handling, test builtin exchange config
Diffstat (limited to 'packages/taler-wallet-core/src/host-impl.node.ts')
-rw-r--r--packages/taler-wallet-core/src/host-impl.node.ts30
1 files changed, 18 insertions, 12 deletions
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) {