gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated: better diagnostics


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: better diagnostics from fakebank
Date: Sun, 10 Dec 2017 21:19:33 +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 878c68f  better diagnostics from fakebank
878c68f is described below

commit 878c68faf6fa02f20771120231d1f2eddb12285d
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Dec 10 21:19:30 2017 +0100

    better diagnostics from fakebank
---
 src/bank-lib/fakebank.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index bd1b3b2..d83c22a 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -170,19 +170,21 @@ TALER_FAKEBANK_check (struct TALER_FAKEBANK_Handle *h,
            "Did not find matching transaction!\nI have:\n");
   for (struct Transaction *t = h->transactions_head; NULL != t; t = t->next)
   {
-    char *s;
-
     if (GNUNET_YES == t->checked)
       continue;
-    s = TALER_amount_to_string (&t->amount);
     fprintf (stderr,
              "%llu -> %llu (%s) from %s\n",
              (unsigned long long) t->debit_account,
              (unsigned long long) t->credit_account,
-             s,
+             TALER_amount2s (&t->amount),
              t->exchange_base_url);
-    GNUNET_free (s);
   }
+  fprintf (stderr,
+           "I wanted:\n%llu -> %llu (%s) from %s\n",
+           (unsigned long long) want_debit,
+           (unsigned long long) want_credit,
+           TALER_amount2s (want_amount),
+           exchange_base_url);
   return GNUNET_SYSERR;
 }
 
@@ -828,9 +830,10 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
                                                      ? pos->credit_account
                                                      : pos->debit_account),
                        "wt_subject", subject);
+    GNUNET_assert (NULL != trans);
     GNUNET_free (subject);
-    json_array_append (history,
-                       trans);
+    GNUNET_assert (0 == json_array_append (history,
+                                           trans));
     if (count > 0)
     {
       pos = pos->next;
@@ -860,7 +863,8 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
   }
 
   jresponse = json_pack ("{s:o}",
-                         "data", history);
+                         "data",
+                         history);
   if (NULL == jresponse)
   {
     GNUNET_break (0);

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]