gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: pass wire fees to coin select


From: gnunet
Subject: [taler-wallet-core] branch master updated: pass wire fees to coin selection, logging
Date: Thu, 07 Mar 2024 13:22:49 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new b059cf4b1 pass wire fees to coin selection, logging
b059cf4b1 is described below

commit b059cf4b16663ef2db70a2c2d7af0a6ba5ce2688
Author: Florian Dold <florian@dold.me>
AuthorDate: Thu Mar 7 13:22:34 2024 +0100

    pass wire fees to coin selection, logging
---
 packages/taler-wallet-core/src/coinSelection.ts  | 11 +++++++++++
 packages/taler-wallet-core/src/host-impl.node.ts |  6 ++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-core/src/coinSelection.ts 
b/packages/taler-wallet-core/src/coinSelection.ts
index 50965fd6c..672d0ee79 100644
--- a/packages/taler-wallet-core/src/coinSelection.ts
+++ b/packages/taler-wallet-core/src/coinSelection.ts
@@ -185,6 +185,10 @@ export async function selectPayCoins(
 ): Promise<SelectPayCoinsResult> {
   const { contractTermsAmount, depositFeeLimit, wireFeeLimit } = req;
 
+  if (logger.shouldLogTrace()) {
+    logger.trace(`selecting coins for ${j2s(req)}`);
+  }
+
   return await wex.db.runReadOnlyTx(
     [
       "coinAvailability",
@@ -207,6 +211,8 @@ export async function selectPayCoins(
         },
       );
 
+      logger.trace(`wire fees per exchange: ${j2s(wireFeesPerExchange)}`);
+
       const coinRes: SelectedCoin[] = [];
       const currency = contractTermsAmount.currency;
 
@@ -274,6 +280,10 @@ export async function selectPayCoins(
         tally,
       );
 
+      if (logger.shouldLogTrace()) {
+        logger.trace(`coin selection: ${j2s(coinSel)}`);
+      }
+
       return {
         type: "success",
         coinSel,
@@ -766,6 +776,7 @@ async function selectPayCandidates(
       if (!wire) {
         continue;
       }
+      wfPerExchange[exchange.baseUrl] = wire.wireFee;
     }
 
     // 3. exchange is trusted in the exchange list or auditor list
diff --git a/packages/taler-wallet-core/src/host-impl.node.ts 
b/packages/taler-wallet-core/src/host-impl.node.ts
index 6a32a086a..ec026b296 100644
--- a/packages/taler-wallet-core/src/host-impl.node.ts
+++ b/packages/taler-wallet-core/src/host-impl.node.ts
@@ -110,8 +110,10 @@ async function makeSqliteDb(
 ): Promise<MakeDbResult> {
   BridgeIDBFactory.enableTracing = false;
   const imp = await createNodeSqlite3Impl();
+  const dbFilename = args.persistentStoragePath ?? ":memory:";
+  logger.info(`using database ${dbFilename}`);
   const myBackend = await createSqliteBackend(imp, {
-    filename: args.persistentStoragePath ?? ":memory:",
+    filename: dbFilename,
   });
   myBackend.enableTracing = false;
   if (process.env.TALER_WALLET_DBSTATS) {
@@ -159,7 +161,7 @@ export async function createNativeWalletHost2(
     logger.info("using JSON file DB backend (slow, only use for testing)");
     dbResp = await makeFileDb(args);
   } else {
-    logger.info("using sqlite3 DB backend");
+    logger.info(`using sqlite3 DB backend`);
     dbResp = await makeSqliteDb(args);
   }
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]