gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated (c1d7578e -> abef0721)


From: gnunet
Subject: [taler-merchant] branch master updated (c1d7578e -> abef0721)
Date: Sun, 20 Mar 2022 13:20:29 +0100

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

grothoff pushed a change to branch master
in repository merchant.

    from c1d7578e [build int] Use ‘MHD_VERSION_AT_LEAST’
     new 54ea5367 -minor code cleanup
     new abef0721 -update API for latest exchange API

The 2 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:
 src/backend/taler-merchant-httpd_auditors.c |  2 +-
 src/backend/taler-merchant-httpd_reserves.c | 25 +++++++++----------------
 src/testing/test_merchant_api.c             | 12 +++++-------
 3 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_auditors.c 
b/src/backend/taler-merchant-httpd_auditors.c
index 27b3524a..a1d70053 100644
--- a/src/backend/taler-merchant-httpd_auditors.c
+++ b/src/backend/taler-merchant-httpd_auditors.c
@@ -62,7 +62,7 @@ static unsigned int nauditors;
 json_t *j_auditors;
 
 
-int
+enum GNUNET_GenericReturnValue
 TMH_AUDITORS_check_dk (struct TALER_EXCHANGE_Handle *mh,
                        const struct TALER_EXCHANGE_DenomPublicKey *dk,
                        bool exchange_trusted,
diff --git a/src/backend/taler-merchant-httpd_reserves.c 
b/src/backend/taler-merchant-httpd_reserves.c
index 15c03847..50af145f 100644
--- a/src/backend/taler-merchant-httpd_reserves.c
+++ b/src/backend/taler-merchant-httpd_reserves.c
@@ -169,53 +169,46 @@ try_later (struct Reserve *r)
  * reserve status request to a exchange.
  *
  * @param cls closure with a `struct Reserve *`
- * @param hr HTTP response data
- * @param balance current balance in the reserve, NULL on error
- * @param history_length number of entries in the transaction history, 0 on 
error
- * @param history detailed transaction history, NULL on error
+ * @param rs HTTP response data
  */
 static void
 reserve_cb (void *cls,
-            const struct TALER_EXCHANGE_HttpResponse *hr,
-            const struct TALER_Amount *balance,
-            unsigned int history_length,
-            const struct TALER_EXCHANGE_ReserveHistory *history)
+            const struct TALER_EXCHANGE_ReserveSummary *rs)
 {
   struct Reserve *r = cls;
   enum GNUNET_DB_QueryStatus qs;
 
   r->gh = NULL;
-  if ( (NULL == hr) ||
-       (MHD_HTTP_OK != hr->http_status) )
+  if (MHD_HTTP_OK != rs->hr.http_status)
   {
     try_later (r);
     return;
   }
   if (GNUNET_OK !=
       TALER_amount_cmp_currency (&r->expected_amount,
-                                 balance))
+                                 &rs->details.ok.balance))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Reserve currency disagreement: exchange `%s' has %s, expected 
%s\n",
                 r->exchange_url,
-                balance->currency,
+                rs->details.ok.balance.currency,
                 r->expected_amount.currency);
     free_reserve (r);
     return;
   }
   if (0 !=
       TALER_amount_cmp (&r->expected_amount,
-                        balance))
+                        &rs->details.ok.balance))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "Reserve initial balance disagreement: exchange `%s' received 
`%s'\n",
                 r->exchange_url,
-                TALER_amount2s (balance));
+                TALER_amount2s (&rs->details.ok.balance));
   }
   qs = TMH_db->activate_reserve (TMH_db->cls,
                                  r->instance_id,
                                  &r->reserve_pub,
-                                 balance);
+                                 &rs->details.ok.balance);
   if (qs <= 0)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -226,7 +219,7 @@ reserve_cb (void *cls,
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Reserve activated with initial balance %s\n",
-                TALER_amount2s (balance));
+                TALER_amount2s (&rs->details.ok.balance));
   }
   free_reserve (r);
 }
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index 5c2a8352..8fc0f4ad 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -172,7 +172,8 @@ const char *order_1_forgets_3[] = {
 static struct TALER_TESTING_Command
 cmd_exec_wirewatch (const char *label)
 {
-  return TALER_TESTING_cmd_exec_wirewatch (label, config_file);
+  return TALER_TESTING_cmd_exec_wirewatch (label,
+                                           config_file);
 }
 
 
@@ -260,10 +261,8 @@ run (void *cls,
     cmd_transfer_to_exchange ("create-reserve-1",
                               "EUR:10.02"),
     /**
-     * Make a reserve exist,
-     * according to the previous
-     * transfer.
-     *///
+     * Make a reserve exist, according to the previous transfer.
+     */
     cmd_exec_wirewatch ("wirewatch-1"),
     TALER_TESTING_cmd_check_bank_admin_transfer ("check_bank_transfer-2",
                                                  "EUR:10.02",
@@ -1111,7 +1110,7 @@ run (void *cls,
                                                           "EUR:5.01",
                                                           
TALER_EC_MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_RESERVE_NOT_FOUND),
 
-    // Test reserve with insufficient funds
+    /* Test reserve with insufficient funds */
     TALER_TESTING_cmd_merchant_post_reserves ("create-reserve-tip-2",
                                               merchant_url,
                                               "EUR:1.04",
@@ -1134,7 +1133,6 @@ run (void *cls,
       "tip 4",
       "EUR:5.01",
       TALER_EC_MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_INSUFFICIENT_FUNDS),
-
     TALER_TESTING_cmd_tip_authorize_fake ("fake-tip-authorization"),
     TALER_TESTING_cmd_tip_pickup_with_ec ("pickup-non-existent-id",
                                           merchant_url,

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