gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: implement #8000


From: gnunet
Subject: [taler-exchange] branch master updated: implement #8000
Date: Fri, 08 Mar 2024 23:17:47 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 2a254b75 implement #8000
2a254b75 is described below

commit 2a254b754dde30f031e38272a4f7e77908682f9a
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Mar 8 23:17:42 2024 +0100

    implement #8000
---
 src/exchange-tools/taler-exchange-offline.c   | 58 ++++++++++++++++++++++++++-
 src/include/taler_exchange_service.h          |  6 ++-
 src/lib/Makefile.am                           |  2 +-
 src/lib/exchange_api_management_wire_enable.c |  7 ++++
 src/testing/testing_api_cmd_wire_add.c        |  2 +
 5 files changed, 71 insertions(+), 4 deletions(-)

diff --git a/src/exchange-tools/taler-exchange-offline.c 
b/src/exchange-tools/taler-exchange-offline.c
index 7380e607..2ad2342f 100644
--- a/src/exchange-tools/taler-exchange-offline.c
+++ b/src/exchange-tools/taler-exchange-offline.c
@@ -1,6 +1,6 @@
 /*
    This file is part of TALER
-   Copyright (C) 2020-2023 Taler Systems SA
+   Copyright (C) 2020-2024 Taler Systems SA
 
    TALER is free software; you can redistribute it and/or modify it under the
    terms of the GNU General Public License as published by the Free Software
@@ -1543,6 +1543,8 @@ upload_wire_add (const char *exchange_url,
   struct WireAddRequest *war;
   const char *err_name;
   const char *conversion_url = NULL;
+  const char *bank_label = NULL;
+  int64_t priority = 0;
   const json_t *debit_restrictions;
   const json_t *credit_restrictions;
   unsigned int err_line;
@@ -1553,6 +1555,12 @@ upload_wire_add (const char *exchange_url,
       TALER_JSON_spec_web_url ("conversion_url",
                                &conversion_url),
       NULL),
+    GNUNET_JSON_spec_mark_optional (
+      GNUNET_JSON_spec_string ("bank_label",
+                               &bank_label),
+      NULL),
+    GNUNET_JSON_spec_int64 ("priority",
+                            &priority),
     GNUNET_JSON_spec_array_const ("debit_restrictions",
                                   &debit_restrictions),
     GNUNET_JSON_spec_array_const ("credit_restrictions",
@@ -1625,6 +1633,8 @@ upload_wire_add (const char *exchange_url,
                                            start_time,
                                            &master_sig_add,
                                            &master_sig_wire,
+                                           bank_label,
+                                           priority,
                                            &wire_add_cb,
                                            war);
   GNUNET_CONTAINER_DLL_insert (war_head,
@@ -3081,6 +3091,8 @@ do_add_wire (char *const *args)
   struct TALER_MasterSignatureP master_sig_wire;
   struct GNUNET_TIME_Timestamp now;
   const char *conversion_url = NULL;
+  const char *bank_label = NULL;
+  int64_t priority = 0;
   json_t *debit_restrictions;
   json_t *credit_restrictions;
   unsigned int num_args = 1;
@@ -3196,6 +3208,43 @@ do_add_wire (char *const *args)
       num_args += iret;
       continue;
     }
+    if (0 == strcmp (args[num_args],
+                     "display-hint"))
+    {
+      long long p;
+      char dummy;
+
+      num_args++;
+      if ( (NULL == args[num_args]) ||
+           (NULL == args[num_args + 1]) )
+      {
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    "'display-hint' requires at least two arguments (priority 
and label)\n");
+        global_ret = EXIT_INVALIDARGUMENT;
+        test_shutdown ();
+        json_decref (debit_restrictions);
+        json_decref (credit_restrictions);
+        return;
+      }
+      if (1 != sscanf (args[num_args],
+                       "%lld%c",
+                       &p,
+                       &dummy))
+      {
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    "Priority argument `%s' is not a number\n",
+                    args[num_args]);
+        global_ret = EXIT_INVALIDARGUMENT;
+        test_shutdown ();
+        json_decref (debit_restrictions);
+        json_decref (credit_restrictions);
+        return;
+      }
+      priority = (int64_t) p;
+      num_args++;
+      bank_label = args[num_args];
+      num_args++;
+    }
     break;
   }
   TALER_exchange_offline_wire_add_sign (args[0],
@@ -3222,6 +3271,11 @@ do_add_wire (char *const *args)
                       GNUNET_JSON_pack_allow_null (
                         GNUNET_JSON_pack_string ("conversion_url",
                                                  conversion_url)),
+                      GNUNET_JSON_pack_allow_null (
+                        GNUNET_JSON_pack_string ("bank_label",
+                                                 bank_label)),
+                      GNUNET_JSON_pack_int64 ("priority",
+                                              priority),
                       GNUNET_JSON_pack_timestamp ("validity_start",
                                                   now),
                       GNUNET_JSON_pack_data_auto ("master_sig_add",
@@ -5263,7 +5317,7 @@ work (void *cls)
     {
       .name = "enable-account",
       .help =
-        "enable wire account of the exchange (payto-URI must be given as 
argument; for optional argument see man page)",
+        "enable wire account of the exchange (payto-URI must be given as 
argument; for optional arguments see man page)",
       .cb = &do_add_wire
     },
     {
diff --git a/src/include/taler_exchange_service.h 
b/src/include/taler_exchange_service.h
index 00a38270..0597799b 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -36,7 +36,7 @@
  * Version of the Taler Exchange API, in hex.
  * Thus 0.8.4-1 = 0x00080401.
  */
-#define TALER_EXCHANGE_API_VERSION 0x00090400
+#define TALER_EXCHANGE_API_VERSION 0x00100000
 
 /* *********************  /keys *********************** */
 
@@ -5818,6 +5818,8 @@ struct TALER_EXCHANGE_ManagementWireEnableHandle;
  *        of purpose #TALER_SIGNATURE_MASTER_ADD_WIRE
  * @param master_sig2 signature affirming the validity of the account for 
clients;
  *        of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS.
+ * @param bank_label label to use when showing the account, can be NULL
+ * @param priority priority for ordering the bank accounts
  * @param cb function to call with the exchange's result
  * @param cb_cls closure for @a cb
  * @return the request handle; NULL upon error
@@ -5833,6 +5835,8 @@ TALER_EXCHANGE_management_enable_wire (
   struct GNUNET_TIME_Timestamp validity_start,
   const struct TALER_MasterSignatureP *master_sig1,
   const struct TALER_MasterSignatureP *master_sig2,
+  const char *bank_label,
+  int64_t priority,
   TALER_EXCHANGE_ManagementWireEnableCallback cb,
   void *cb_cls);
 
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 5d4f54b5..256efd11 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -18,7 +18,7 @@ lib_LTLIBRARIES = \
   libtalerexchange.la
 
 libtalerexchange_la_LDFLAGS = \
-  -version-info 5:0:0 \
+  -version-info 6:0:0 \
   -no-undefined
 libtalerexchange_la_SOURCES = \
   exchange_api_add_aml_decision.c \
diff --git a/src/lib/exchange_api_management_wire_enable.c 
b/src/lib/exchange_api_management_wire_enable.c
index 1982a502..9a163b55 100644
--- a/src/lib/exchange_api_management_wire_enable.c
+++ b/src/lib/exchange_api_management_wire_enable.c
@@ -149,6 +149,8 @@ TALER_EXCHANGE_management_enable_wire (
   struct GNUNET_TIME_Timestamp validity_start,
   const struct TALER_MasterSignatureP *master_sig1,
   const struct TALER_MasterSignatureP *master_sig2,
+  const char *bank_label,
+  int64_t priority,
   TALER_EXCHANGE_ManagementWireEnableCallback cb,
   void *cb_cls)
 {
@@ -192,6 +194,11 @@ TALER_EXCHANGE_management_enable_wire (
     GNUNET_JSON_pack_allow_null (
       GNUNET_JSON_pack_string ("conversion_url",
                                conversion_url)),
+    GNUNET_JSON_pack_allow_null (
+      GNUNET_JSON_pack_string ("bank_label",
+                               bank_label)),
+    GNUNET_JSON_pack_int64 ("priority",
+                            priority),
     GNUNET_JSON_pack_data_auto ("master_sig_add",
                                 master_sig1),
     GNUNET_JSON_pack_data_auto ("master_sig_wire",
diff --git a/src/testing/testing_api_cmd_wire_add.c 
b/src/testing/testing_api_cmd_wire_add.c
index 09d4579c..d2a15894 100644
--- a/src/testing/testing_api_cmd_wire_add.c
+++ b/src/testing/testing_api_cmd_wire_add.c
@@ -177,6 +177,8 @@ wire_add_run (void *cls,
     now,
     &master_sig1,
     &master_sig2,
+    NULL,
+    0LL,
     &wire_add_cb,
     ds);
   json_decref (debit_rest);

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