gnunet-svn
[Top][All Lists]
Advanced

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

[taler-donau] branch master updated: [donau] rename files [lib] adjust m


From: gnunet
Subject: [taler-donau] branch master updated: [donau] rename files [lib] adjust methods
Date: Sun, 26 Nov 2023 23:43:49 +0100

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

lukas-matyja pushed a commit to branch master
in repository donau.

The following commit(s) were added to refs/heads/master by this push:
     new 2de49c1  [donau] rename files [lib] adjust methods
2de49c1 is described below

commit 2de49c1a5f66ba4a637bf59456ebd5fbb4ac02d3
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
AuthorDate: Sun Nov 26 23:44:39 2023 +0100

    [donau] rename files [lib] adjust methods
---
 ...thdraw.c => donau-httpd_batch-issue_receipts.c} |  0
 ...thdraw.h => donau-httpd_batch-issue_receipts.h} |  0
 ...posit.c => donau-httpd_batch-submit_receipts.c} |  0
 ...posit.h => donau-httpd_batch-submit_receipts.h} |  0
 ...erves_close.c => donau-httpd_charities_close.c} |  0
 ...erves_close.h => donau-httpd_charities_close.h} |  0
 ..._reserves_get.c => donau-httpd_charities_get.c} |  0
 ..._reserves_get.h => donau-httpd_charities_get.h} |  0
 ...s_history.c => donau-httpd_charities_history.c} |  0
 ...s_history.h => donau-httpd_charities_history.h} |  0
 ...eserves_open.c => donau-httpd_charities_open.c} |  0
 ...eserves_open.h => donau-httpd_charities_open.h} |  0
 ...ves_status.c => donau-httpd_charities_status.c} |  0
 ...ves_status.h => donau-httpd_charities_status.h} |  0
 ...osit.c => donau-httpd_common_submit_receipts.c} |  0
 ...osit.h => donau-httpd_common_submit_receipts.h} |  0
 ...tpd_withdraw.c => donau-httpd_issue_receipts.c} |  0
 ...tpd_withdraw.h => donau-httpd_issue_receipts.h} |  0
 ...its_get.c => donau-httpd_submit_receipts_get.c} |  0
 ...its_get.h => donau-httpd_submit_receipts_get.h} |  0
 src/lib/donau_api_handle.c                         | 83 ++--------------------
 21 files changed, 4 insertions(+), 79 deletions(-)

diff --git a/src/donau/donau-httpd_batch-withdraw.c 
b/src/donau/donau-httpd_batch-issue_receipts.c
similarity index 100%
rename from src/donau/donau-httpd_batch-withdraw.c
rename to src/donau/donau-httpd_batch-issue_receipts.c
diff --git a/src/donau/donau-httpd_batch-withdraw.h 
b/src/donau/donau-httpd_batch-issue_receipts.h
similarity index 100%
rename from src/donau/donau-httpd_batch-withdraw.h
rename to src/donau/donau-httpd_batch-issue_receipts.h
diff --git a/src/donau/donau-httpd_batch-deposit.c 
b/src/donau/donau-httpd_batch-submit_receipts.c
similarity index 100%
rename from src/donau/donau-httpd_batch-deposit.c
rename to src/donau/donau-httpd_batch-submit_receipts.c
diff --git a/src/donau/donau-httpd_batch-deposit.h 
b/src/donau/donau-httpd_batch-submit_receipts.h
similarity index 100%
rename from src/donau/donau-httpd_batch-deposit.h
rename to src/donau/donau-httpd_batch-submit_receipts.h
diff --git a/src/donau/donau-httpd_reserves_close.c 
b/src/donau/donau-httpd_charities_close.c
similarity index 100%
rename from src/donau/donau-httpd_reserves_close.c
rename to src/donau/donau-httpd_charities_close.c
diff --git a/src/donau/donau-httpd_reserves_close.h 
b/src/donau/donau-httpd_charities_close.h
similarity index 100%
rename from src/donau/donau-httpd_reserves_close.h
rename to src/donau/donau-httpd_charities_close.h
diff --git a/src/donau/donau-httpd_reserves_get.c 
b/src/donau/donau-httpd_charities_get.c
similarity index 100%
rename from src/donau/donau-httpd_reserves_get.c
rename to src/donau/donau-httpd_charities_get.c
diff --git a/src/donau/donau-httpd_reserves_get.h 
b/src/donau/donau-httpd_charities_get.h
similarity index 100%
rename from src/donau/donau-httpd_reserves_get.h
rename to src/donau/donau-httpd_charities_get.h
diff --git a/src/donau/donau-httpd_reserves_history.c 
b/src/donau/donau-httpd_charities_history.c
similarity index 100%
rename from src/donau/donau-httpd_reserves_history.c
rename to src/donau/donau-httpd_charities_history.c
diff --git a/src/donau/donau-httpd_reserves_history.h 
b/src/donau/donau-httpd_charities_history.h
similarity index 100%
rename from src/donau/donau-httpd_reserves_history.h
rename to src/donau/donau-httpd_charities_history.h
diff --git a/src/donau/donau-httpd_reserves_open.c 
b/src/donau/donau-httpd_charities_open.c
similarity index 100%
rename from src/donau/donau-httpd_reserves_open.c
rename to src/donau/donau-httpd_charities_open.c
diff --git a/src/donau/donau-httpd_reserves_open.h 
b/src/donau/donau-httpd_charities_open.h
similarity index 100%
rename from src/donau/donau-httpd_reserves_open.h
rename to src/donau/donau-httpd_charities_open.h
diff --git a/src/donau/donau-httpd_reserves_status.c 
b/src/donau/donau-httpd_charities_status.c
similarity index 100%
rename from src/donau/donau-httpd_reserves_status.c
rename to src/donau/donau-httpd_charities_status.c
diff --git a/src/donau/donau-httpd_reserves_status.h 
b/src/donau/donau-httpd_charities_status.h
similarity index 100%
rename from src/donau/donau-httpd_reserves_status.h
rename to src/donau/donau-httpd_charities_status.h
diff --git a/src/donau/donau-httpd_common_deposit.c 
b/src/donau/donau-httpd_common_submit_receipts.c
similarity index 100%
rename from src/donau/donau-httpd_common_deposit.c
rename to src/donau/donau-httpd_common_submit_receipts.c
diff --git a/src/donau/donau-httpd_common_deposit.h 
b/src/donau/donau-httpd_common_submit_receipts.h
similarity index 100%
rename from src/donau/donau-httpd_common_deposit.h
rename to src/donau/donau-httpd_common_submit_receipts.h
diff --git a/src/donau/donau-httpd_withdraw.c 
b/src/donau/donau-httpd_issue_receipts.c
similarity index 100%
rename from src/donau/donau-httpd_withdraw.c
rename to src/donau/donau-httpd_issue_receipts.c
diff --git a/src/donau/donau-httpd_withdraw.h 
b/src/donau/donau-httpd_issue_receipts.h
similarity index 100%
rename from src/donau/donau-httpd_withdraw.h
rename to src/donau/donau-httpd_issue_receipts.h
diff --git a/src/donau/donau-httpd_deposits_get.c 
b/src/donau/donau-httpd_submit_receipts_get.c
similarity index 100%
rename from src/donau/donau-httpd_deposits_get.c
rename to src/donau/donau-httpd_submit_receipts_get.c
diff --git a/src/donau/donau-httpd_deposits_get.h 
b/src/donau/donau-httpd_submit_receipts_get.h
similarity index 100%
rename from src/donau/donau-httpd_deposits_get.h
rename to src/donau/donau-httpd_submit_receipts_get.h
diff --git a/src/lib/donau_api_handle.c b/src/lib/donau_api_handle.c
index 8ccc071..ebaffec 100644
--- a/src/lib/donau_api_handle.c
+++ b/src/lib/donau_api_handle.c
@@ -22,6 +22,7 @@
  * @brief Implementation of the "handle" component of the donau's HTTP API
  * @author Sree Harsha Totakura <sreeharsha@totakura.in>
  * @author Christian Grothoff
+ * @author Lukas Matyja
  */
 #include "platform.h"
 #include <microhttpd.h>
@@ -33,6 +34,7 @@
 #include "donau_api_curl_defaults.h"
 #include "backoff.h"
 #include "taler_curl_lib.h"
+#include <gnunet/gnunet_crypto_lib.h>
 
 /**
  * Which version of the Taler protocol is implemented
@@ -264,41 +266,6 @@ EXITIF_exit:
 }
 
 
-/**
- * Compare two donation unit keys.
- *
- * @param denom1 first donation unit key
- * @param denom2 second donation unit key
- * @return 0 if the two keys are equal (not necessarily
- *  the same object), 1 otherwise.
- */
-static unsigned int
-denoms_cmp (const struct TALER_DonationUnitInformation *du1,
-            const struct TALER_DonationUnitInformation *du2)
-{
-  struct TALER_DONAU_DenomPublicKey tmp1;
-  struct TALER_DONAU_DenomPublicKey tmp2;
-
-  if (0 !=
-      TALER_denom_pub_cmp (&du1->key,
-                           &du2->key))
-    return 1;
-  tmp1 = *du1;
-  tmp2 = *du2;
-  if (tmp1.year != tmp2.year)
-    return 1;
-
-  memset (&tmp1.key,
-          0,
-          sizeof (tmp1.key));
-  memset (&tmp2.key,
-          0,
-          sizeof (tmp2.key));
-  return GNUNET_memcmp (&tmp1,
-                        &tmp2);
-}
-
-
 /**
  * Decode the JSON in @a resp_obj from the /keys response
  * and store the data in the @a key_data.
@@ -689,7 +656,7 @@ decode_keys_json (const json_t *resp_obj,
              j<key_data->num_denom_keys;
              j++)
         {
-          if (0 == denoms_cmp (&dk,
+          if (0 == GNUNET_CRYPTO_bsign_pub_cmp (&dk,
                                &key_data->denom_keys[j]))
           {
             found = true;
@@ -1180,7 +1147,6 @@ TALER_DONAU_get_keys (
 {
   struct TALER_DONAU_GetKeysHandle *gkh;
   CURL *eh;
-  char last_date[80] = { 0 };
 
   TALER_LOG_DEBUG ("Connecting to the donau (%s)\n",
                    url);
@@ -1188,28 +1154,8 @@ TALER_DONAU_get_keys (
   gkh->donau_url = GNUNET_strdup (url);
   gkh->cert_cb = cert_cb;
   gkh->cert_cb_cls = cert_cb_cls;
-  if (NULL != last_keys)
-  {
-    gkh->prev_keys = TALER_DONAU_keys_incref (last_keys);
-    TALER_LOG_DEBUG ("Last DK issue date (before GETting /keys): %s\n",
-                     GNUNET_TIME_timestamp2s (
-                       last_keys->last_denom_issue_date));
-    GNUNET_snprintf (last_date,
-                     sizeof (last_date),
-                     "%llu",
-                     (unsigned long long)
-                     last_keys->last_denom_issue_date.abs_time.abs_value_us
-                     / 1000000LLU);
-  }
   gkh->url = TALER_url_join (url,
-                             "keys",
-                             (NULL != last_keys)
-                             ? "last_issue_date"
-                             : NULL,
-                             (NULL != last_keys)
-                             ? last_date
-                             : NULL,
-                             NULL);
+                             "keys");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Requesting keys with URL `%s'.\n",
               gkh->url);
@@ -1306,27 +1252,6 @@ TALER_DONAU_get_denomination_key (
 }
 
 
-const struct TALER_DONAU_GlobalFee *
-TALER_DONAU_get_global_fee (
-  const struct TALER_DONAU_Keys *keys,
-  struct GNUNET_TIME_Timestamp ts)
-{
-  for (unsigned int i = 0; i<keys->num_global_fees; i++)
-  {
-    const struct TALER_DONAU_GlobalFee *gf = &keys->global_fees[i];
-
-    if (GNUNET_TIME_timestamp_cmp (ts,
-                                   >=,
-                                   gf->start_date) &&
-        GNUNET_TIME_timestamp_cmp (ts,
-                                   <,
-                                   gf->end_date))
-      return gf;
-  }
-  return NULL;
-}
-
-
 struct TALER_DONAU_DenomPublicKey *
 TALER_DONAU_copy_denomination_key (
   const struct TALER_DONAU_DenomPublicKey *key)

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