gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated (f622a036a -> 6c3635e2f)


From: gnunet
Subject: [taler-wallet-core] branch master updated (f622a036a -> 6c3635e2f)
Date: Tue, 07 Jan 2025 16:25:01 +0100

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

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

    from f622a036a new prebuilt dev
     new 0d04772c9 -logging
     new 9208e55b8 -logging
     new 6c3635e2f -minor fixes

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/idb-bridge/taler-helper-sqlite3        | 38 +++++++++++++------------
 packages/taler-util/src/types-taler-exchange.ts |  3 ++
 packages/taler-util/src/types-taler-wallet.ts   |  8 ++++++
 packages/taler-wallet-core/src/pay-merchant.ts  |  6 ++++
 packages/taler-wallet-core/src/withdraw.ts      |  2 --
 5 files changed, 37 insertions(+), 20 deletions(-)

diff --git a/packages/idb-bridge/taler-helper-sqlite3 
b/packages/idb-bridge/taler-helper-sqlite3
index 02a936220..a04758bb5 100755
--- a/packages/idb-bridge/taler-helper-sqlite3
+++ b/packages/idb-bridge/taler-helper-sqlite3
@@ -7,9 +7,14 @@ import os
 print("started sqlite3 helper at", os.getcwd(), file=sys.stderr)
 
 enable_tracing = False
+
+
 def trace(*args):
+    if not enable_tracing:
+        return
     print("HELPER", *args, file=sys.stderr)
 
+
 CMD_HELLO = 1
 CMD_SHUTDOWN = 2
 CMD_OPEN = 3
@@ -46,8 +51,7 @@ prep_handles = dict()
 
 
 def write_resp(req_id, cmd, payload=None):
-    if enable_tracing:
-        trace("sending response to request", req_id)
+    trace("sending response to request", req_id)
     outlen = 4 + 4 + 1 + (0 if payload is None else len(payload))
     respstream.write(outlen.to_bytes(4))
     respstream.write(req_id.to_bytes(4))
@@ -100,7 +104,7 @@ class PacketWriter:
 
         for row in rows:
             if len(row) != len(description):
-                raise Error("invariant violated")
+                raise Exception("invariant violated")
             for val in row:
                 if val is None:
                     self.write_uint8(TAG_NULL)
@@ -114,7 +118,7 @@ class PacketWriter:
                     self.write_uint8(TAG_INT)
                     self.write_int64(val)
                 else:
-                    raise Error("unknown col type")
+                    raise Exception("unknown col type")
 
     def reap(self):
         return b"".join(self.chunks)
@@ -175,15 +179,17 @@ class PacketReader:
             if tag == TAG_BLOB:
                 params[name] = pr.read_blob()
                 continue
-            raise Error("tag not understood")
+            raise Exception("tag not understood")
         return params
 
+
 def read_exactly(n):
     buf = cmdstream.read(n)
     if len(buf) != n:
-        raise Error("incomplete message") 
+        raise Exception("incomplete message")
     return buf
 
+
 def handle_query_failure(req_id, e):
     pw = PacketWriter()
     pw.write_string(str(e))
@@ -191,22 +197,21 @@ def handle_query_failure(req_id, e):
     pw.write_string(e.sqlite_errorname)
     write_resp(req_id, RESP_FAIL, pw.reap())
 
+
 while True:
-    if enable_tracing:
-        trace("reading command")
+    trace("reading command")
     buf_sz = cmdstream.read(4)
     if len(buf_sz) == 0:
         trace("end of input reached")
         sys.exit(0)
     elif len(buf_sz) != 4:
-        raise Error("incomplete message")
+        raise Exception("incomplete message")
     size = int.from_bytes(buf_sz)
     req_id = int.from_bytes(read_exactly(4))
     rest = read_exactly(size - 8)
     pr = PacketReader(rest)
     cmd = pr.read_uint8()
-    if enable_tracing:
-        trace("received command:", cmd, "request_id:", req_id)
+    trace("received command:", cmd, "request_id:", req_id)
 
     if cmd == CMD_HELLO:
         write_resp(req_id, RESP_OK)
@@ -214,7 +219,7 @@ while True:
     if cmd == CMD_OPEN:
         # open
         if dbconn is not None:
-            raise Error("DB already connected")
+            raise Exception("DB already connected")
         db_handle = pr.read_uint16()
         filename = pr.read_string()
         dbconn = sqlite3.connect(filename, autocommit=True, 
isolation_level=None)
@@ -267,8 +272,7 @@ while True:
         write_resp(req_id, RESP_ROWLIST, pw.reap())
         continue
     if cmd == CMD_STMT_RUN:
-        if enable_tracing:
-            trace("running statement")
+        trace("running statement")
         prep_id = pr.read_uint16()
         params = pr.read_params()
         dbconn, stmt = prep_handles[prep_id]
@@ -276,12 +280,10 @@ while True:
         try:
             res = cursor.execute(stmt, params)
         except sqlite3.Error as e:
-            if enable_tracing:
-                trace("got sqlite error")
+            trace("got sqlite error")
             handle_query_failure(req_id, e)
             continue
-        if enable_tracing:
-            trace("running query succeeded")
+        trace("running query succeeded")
         if cursor.lastrowid is None:
             write_resp(req_id, RESP_OK)
         else:
diff --git a/packages/taler-util/src/types-taler-exchange.ts 
b/packages/taler-util/src/types-taler-exchange.ts
index 6210c272d..4b4c37d7d 100644
--- a/packages/taler-util/src/types-taler-exchange.ts
+++ b/packages/taler-util/src/types-taler-exchange.ts
@@ -408,6 +408,8 @@ export interface ExchangeKeysJson {
 
   currency: string;
 
+  asset_type: string;
+
   currency_specification?: CurrencySpecification;
 
   /**
@@ -948,6 +950,7 @@ export const codecForExchangeKeysJson = (): 
Codec<ExchangeKeysJson> =>
     .deprecatedProperty("rewards_allowed")
     .property("exchange_pub", codecForEddsaPublicKey())
     .property("exchange_sig", codecForEddsaSignature())
+    .property("asset_type", codecForString())
     .build("ExchangeKeysJson");
 
 export const codecForWireFeesJson = (): Codec<WireFeesJson> =>
diff --git a/packages/taler-util/src/types-taler-wallet.ts 
b/packages/taler-util/src/types-taler-wallet.ts
index 90d5b88be..007b5e9af 100644
--- a/packages/taler-util/src/types-taler-wallet.ts
+++ b/packages/taler-util/src/types-taler-wallet.ts
@@ -2507,6 +2507,14 @@ export interface WithdrawUriInfoResponse {
   confirmTransferUrl?: string;
   currency: string;
   amount: AmountString | undefined;
+
+  /**
+   * Set to true if the user is allowed to edit the amount.
+   *
+   * Note that even with a non-editable amount, the amount
+   * might be undefined at the beginning of the withdrawal
+   * process.
+   */
   editableAmount: boolean;
   maxAmount: AmountString | undefined;
   wireFee: AmountString | undefined;
diff --git a/packages/taler-wallet-core/src/pay-merchant.ts 
b/packages/taler-wallet-core/src/pay-merchant.ts
index b0f010c47..360eea71e 100644
--- a/packages/taler-wallet-core/src/pay-merchant.ts
+++ b/packages/taler-wallet-core/src/pay-merchant.ts
@@ -3387,6 +3387,8 @@ async function processPurchaseAbortingRefund(
     cancellationToken: wex.cancellationToken,
   });
 
+  logger.trace(`abort response status: ${j2s(abortHttpResp.status)}`);
+
   if (abortHttpResp.status === HttpStatusCode.NotFound) {
     const err = await readTalerErrorResponse(abortHttpResp);
     if (
@@ -3409,6 +3411,10 @@ async function processPurchaseAbortingRefund(
     codecForAbortResponse(),
   );
 
+  if (logger.shouldLogTrace()) {
+    logger.trace(`abort response: ${j2s(abortResp)}`);
+  }
+
   const refunds: MerchantCoinRefundStatus[] = [];
 
   if (abortResp.refunds.length != abortingCoins.length) {
diff --git a/packages/taler-wallet-core/src/withdraw.ts 
b/packages/taler-wallet-core/src/withdraw.ts
index 0217bfb2c..952de45e4 100644
--- a/packages/taler-wallet-core/src/withdraw.ts
+++ b/packages/taler-wallet-core/src/withdraw.ts
@@ -2571,8 +2571,6 @@ export async function getExchangeWithdrawalInfo(
     throw Error("exchange is in invalid state");
   }
 
-  logger.info(`exchange ready summary: ${j2s(exchange)}`);
-
   const ret: ExchangeWithdrawalDetails = {
     exchangePaytoUris: paytoUris,
     exchangeWireAccounts,

-- 
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]