gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -GET purse test passes


From: gnunet
Subject: [taler-exchange] branch master updated: -GET purse test passes
Date: Sat, 30 Apr 2022 17:35:26 +0200

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 f99fb9ad -GET purse test passes
f99fb9ad is described below

commit f99fb9ad4b2b2c046de9e1eccebfde8f60e4fa83
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Apr 30 17:35:24 2022 +0200

    -GET purse test passes
---
 src/exchange/taler-exchange-httpd_purses_deposit.c | 29 ++++++++++----------
 src/exchange/taler-exchange-httpd_purses_get.c     | 16 ++++++++++-
 src/exchange/taler-exchange-httpd_purses_merge.c   | 31 +++++++++++-----------
 3 files changed, 45 insertions(+), 31 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_purses_deposit.c 
b/src/exchange/taler-exchange-httpd_purses_deposit.c
index 95c5d52f..07fcfb1a 100644
--- a/src/exchange/taler-exchange-httpd_purses_deposit.c
+++ b/src/exchange/taler-exchange-httpd_purses_deposit.c
@@ -277,20 +277,6 @@ deposit_transaction (void *cls,
       return GNUNET_DB_STATUS_HARD_ERROR;
     }
   }
-  {
-    struct TALER_PurseEventP rep = {
-      .header.size = htons (sizeof (rep)),
-      .header.type = htons (TALER_DBEVENT_EXCHANGE_PURSE_DEPOSITED),
-      .purse_pub = *pcc->purse_pub
-    };
-
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Notifying about purse deposit\n");
-    TEH_plugin->event_notify (TEH_plugin->cls,
-                              &rep.header,
-                              NULL,
-                              0);
-  }
   return qs;
 }
 
@@ -656,6 +642,21 @@ TEH_handler_purses_deposit (
       return mhd_ret;
     }
   }
+  {
+    struct TALER_PurseEventP rep = {
+      .header.size = htons (sizeof (rep)),
+      .header.type = htons (TALER_DBEVENT_EXCHANGE_PURSE_DEPOSITED),
+      .purse_pub = *pcc.purse_pub
+    };
+
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                "Notifying about purse deposit %s\n",
+                TALER_B2S (pcc.purse_pub));
+    TEH_plugin->event_notify (TEH_plugin->cls,
+                              &rep.header,
+                              NULL,
+                              0);
+  }
 
   /* generate regular response */
   {
diff --git a/src/exchange/taler-exchange-httpd_purses_get.c 
b/src/exchange/taler-exchange-httpd_purses_get.c
index b9cd9c43..59cfa35f 100644
--- a/src/exchange/taler-exchange-httpd_purses_get.c
+++ b/src/exchange/taler-exchange-httpd_purses_get.c
@@ -176,6 +176,11 @@ db_event_cb (void *cls,
 
   (void) extra;
   (void) extra_size;
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Waking up on %p - %p - %s\n",
+              rc,
+              gc,
+              gc->suspended ? "suspended" : "active");
   if (NULL == gc)
     return; /* event triggered while main transaction
                was still running */
@@ -280,13 +285,19 @@ TEH_handler_purses_get (struct TEH_RequestContext *rc,
       };
 
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                  "Starting DB event listening\n");
+                  "Starting DB event listening on purse %s\n",
+                  TALER_B2S (&gc->purse_pub));
       gc->eh = TEH_plugin->event_listen (
         TEH_plugin->cls,
         GNUNET_TIME_absolute_get_remaining (gc->timeout),
         &rep.header,
         &db_event_cb,
         rc);
+      if (NULL == gc->eh)
+      {
+        GNUNET_break (0);
+        gc->timeout = GNUNET_TIME_UNIT_ZERO_ABS;
+      }
     }
   } /* end first-time initialization */
 
@@ -332,6 +343,9 @@ TEH_handler_purses_get (struct TEH_RequestContext *rc,
                                          gc->purse_expiration));
   }
 
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Deposited amount is %s\n",
+              TALER_amount2s (&gc->deposited));
   if (GNUNET_TIME_absolute_is_future (gc->timeout) &&
       ( ((gc->wait_for_merge) &&
          GNUNET_TIME_absolute_is_never (gc->merge_timestamp.abs_time)) ||
diff --git a/src/exchange/taler-exchange-httpd_purses_merge.c 
b/src/exchange/taler-exchange-httpd_purses_merge.c
index 12a2008f..a95f4ce4 100644
--- a/src/exchange/taler-exchange-httpd_purses_merge.c
+++ b/src/exchange/taler-exchange-httpd_purses_merge.c
@@ -308,22 +308,6 @@ merge_transaction (void *cls,
     GNUNET_free (partner_url);
     return GNUNET_DB_STATUS_HARD_ERROR;
   }
-
-  {
-    struct TALER_PurseEventP rep = {
-      .header.size = htons (sizeof (rep)),
-      .header.type = htons (TALER_DBEVENT_EXCHANGE_PURSE_MERGED),
-      .purse_pub = *pcc->purse_pub
-    };
-
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Notifying about purse merge\n");
-    TEH_plugin->event_notify (TEH_plugin->cls,
-                              &rep.header,
-                              NULL,
-                              0);
-  }
-
   return qs;
 }
 
@@ -550,6 +534,21 @@ TEH_handler_purses_merge (
     }
   }
 
+  {
+    struct TALER_PurseEventP rep = {
+      .header.size = htons (sizeof (rep)),
+      .header.type = htons (TALER_DBEVENT_EXCHANGE_PURSE_MERGED),
+      .purse_pub = *pcc.purse_pub
+    };
+
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                "Notifying about purse merge\n");
+    TEH_plugin->event_notify (TEH_plugin->cls,
+                              &rep.header,
+                              NULL,
+                              0);
+  }
+
   GNUNET_free (pcc.provider_url);
   /* generate regular response */
   return reply_merge_success (connection,

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