gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] 50/277: misc fixes


From: gnunet
Subject: [taler-merchant] 50/277: misc fixes
Date: Sun, 05 Jul 2020 20:49:23 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

commit 338895460158b98d3f8dfc4512e6b8d165d1aae5
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Apr 24 21:05:16 2020 +0200

    misc fixes
---
 src/backend/taler-merchant-httpd_private-post-instances.c | 11 +++++++++--
 src/backenddb/plugin_merchantdb_postgres.c                |  2 --
 src/lib/merchant_api_get_instances.c                      |  2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-post-instances.c 
b/src/backend/taler-merchant-httpd_private-post-instances.c
index 6309d76..609753f 100644
--- a/src/backend/taler-merchant-httpd_private-post-instances.c
+++ b/src/backend/taler-merchant-httpd_private-post-instances.c
@@ -246,6 +246,7 @@ TMH_private_post_instances (const struct TMH_RequestHandler 
*rh,
 
     if (! json_is_array (payto_uris))
     {
+      GNUNET_break_op (0);
       payto_ok = false;
       len = 0;
     }
@@ -260,6 +261,7 @@ TMH_private_post_instances (const struct TMH_RequestHandler 
*rh,
 
       if (! json_is_string (payto_uri))
       {
+        GNUNET_break_op (0);
         payto_ok = false;
         break;
       }
@@ -271,6 +273,7 @@ TMH_private_post_instances (const struct TMH_RequestHandler 
*rh,
         if (json_equal (payto_uri,
                         old_uri))
         {
+          GNUNET_break_op (0);
           payto_ok = false;
           break;
         }
@@ -286,7 +289,7 @@ TMH_private_post_instances (const struct TMH_RequestHandler 
*rh,
                                     &salt,
                                     sizeof (salt));
         wm = GNUNET_new (struct TMH_WireMethod);
-        wm->j_wire = json_pack ("{s:s, s:o}",
+        wm->j_wire = json_pack ("{s:O, s:o}",
                                 "payto_uri", payto_uri,
                                 "salt", GNUNET_JSON_from_data_auto (&salt));
         GNUNET_assert (NULL != wm->j_wire);
@@ -295,6 +298,7 @@ TMH_private_post_instances (const struct TMH_RequestHandler 
*rh,
             TALER_JSON_merchant_wire_signature_hash (wm->j_wire,
                                                      &wm->h_wire))
         {
+          GNUNET_break_op (0);
           payto_ok = false;
           GNUNET_free (wm);
           break;
@@ -372,7 +376,8 @@ TMH_private_post_instances (const struct TMH_RequestHandler 
*rh,
           GNUNET_JSON_spec_string ("payto_uri",
                                    &ad.payto_uri),
           GNUNET_JSON_spec_fixed_auto ("salt",
-                                       &ad.salt)
+                                       &ad.salt),
+          GNUNET_JSON_spec_end ()
         };
 
         GNUNET_assert (GNUNET_OK ==
@@ -393,6 +398,8 @@ TMH_private_post_instances (const struct TMH_RequestHandler 
*rh,
         goto retry;
       }
       qs = TMH_db->commit (TMH_db->cls);
+      if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+        qs = GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
 retry:
       if (GNUNET_DB_STATUS_SOFT_ERROR != qs)
         break; /* success! -- or hard failure */
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index b654b44..c12978a 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -436,8 +436,6 @@ lookup_instances_cb (void *cls,
                                     &lic->is.id),
       GNUNET_PQ_result_spec_string ("merchant_name",
                                     &lic->is.name),
-      GNUNET_PQ_result_spec_string ("id",
-                                    &lic->is.id),
       TALER_PQ_result_spec_json ("address",
                                  &lic->is.address),
       TALER_PQ_result_spec_json ("jurisdiction",
diff --git a/src/lib/merchant_api_get_instances.c 
b/src/lib/merchant_api_get_instances.c
index 0ad33fa..604267c 100644
--- a/src/lib/merchant_api_get_instances.c
+++ b/src/lib/merchant_api_get_instances.c
@@ -86,7 +86,7 @@ parse_instances (const json_t *ia,
     struct GNUNET_JSON_Specification spec[] = {
       GNUNET_JSON_spec_string ("name",
                                &ii->name),
-      GNUNET_JSON_spec_string ("instance",
+      GNUNET_JSON_spec_string ("id",
                                &ii->id),
       GNUNET_JSON_spec_fixed_auto ("merchant_pub",
                                    &ii->merchant_pub),

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