gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: update


From: gnunet
Subject: [taler-merchant] branch master updated: update
Date: Thu, 17 Nov 2022 13:36:17 +0100

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

priscilla-huang pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 6efc5477 update
6efc5477 is described below

commit 6efc5477e7bebfc1d251d06b57baf08080d8ff93
Author: priscilla <priscilla.huang@efrei.net>
AuthorDate: Thu Nov 17 07:36:00 2022 -0500

    update
---
 src/backenddb/merchant-0004.sql            |  2 +-
 src/backenddb/plugin_merchantdb_postgres.c | 20 +++++++++++---------
 src/backenddb/test_merchantdb.c            |  5 +++++
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/backenddb/merchant-0004.sql b/src/backenddb/merchant-0004.sql
index 204f14ca..62862937 100644
--- a/src/backenddb/merchant-0004.sql
+++ b/src/backenddb/merchant-0004.sql
@@ -41,7 +41,7 @@ CREATE TABLE IF NOT EXISTS merchant_template
   ,template_contract VARCHAR NOT NULL -- in JSON format
   ,UNIQUE (merchant_serial, template_id)
   );
-COMMENT ON TABLE merchant_template
+COMMENT ON TABLE merchant_template  
   IS 'template used by the merchant (may be incomplete, frontend can 
override)';
 COMMENT ON COLUMN merchant_template.template_description
   IS 'Human-readable template description';
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 11ee8db6..fe4a045f 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -6864,7 +6864,7 @@ postgres_insert_template (void *cls,
     GNUNET_PQ_query_param_string (template_id),
     GNUNET_PQ_query_param_string (pd->template_description),
     GNUNET_PQ_query_param_string (pd->image),
-    GNUNET_PQ_query_param_json_t (pd->template_contract),
+    TALER_PQ_query_param_json (pd->template_contract),
     GNUNET_PQ_query_param_end
 
   };
@@ -6898,7 +6898,7 @@ postgres_update_template (void *cls,
     GNUNET_PQ_query_param_string (template_id),
     GNUNET_PQ_query_param_string (pd->template_description),
     GNUNET_PQ_query_param_string (pd->image),
-    GNUNET_PQ_query_param_json_t (pd->template_contract),
+    TALER_PQ_query_param_json (pd->template_contract),
     GNUNET_PQ_query_param_end
   };
 
@@ -6923,7 +6923,7 @@ struct LookupTemplateContext
   /**
    * Function to call with the results.
    */
-  TALER_MERCHANTDB_TemplateCallback cb;
+  TALER_MERCHANTDB_TemplatesCallback cb;
 
   /**
    * Closure for @a cb.
@@ -6955,6 +6955,7 @@ lookup_templates_cb (void *cls,
   for (unsigned int i = 0; i < num_results; i++)
   {
     char *template_id;
+    char *template_description;
     struct GNUNET_PQ_ResultSpec rs[] = {
       GNUNET_PQ_result_spec_string ("template_id",
                                     &template_id),
@@ -6973,7 +6974,8 @@ lookup_templates_cb (void *cls,
       return;
     }
     tlc->cb (tlc->cb_cls,
-             template_id);
+             template_id,
+             template_description);
     GNUNET_PQ_cleanup_result (rs);
   }
 }
@@ -6991,7 +6993,7 @@ lookup_templates_cb (void *cls,
 static enum GNUNET_DB_QueryStatus
 postgres_lookup_templates (void *cls,
                           const char *instance_id,
-                          TALER_MERCHANTDB_TemplateCallback cb,
+                          TALER_MERCHANTDB_TemplatesCallback cb,
                           void *cb_cls)
 {
   struct PostgresClosure *pg = cls;
@@ -7061,7 +7063,7 @@ postgres_lookup_template (void *cls,
                                     &pd->template_description),
       GNUNET_PQ_result_spec_string ("image",
                                     &pd->image),
-      GNUNET_PQ_result_spec_json_t ("template_contract",
+      TALER_PQ_result_spec_json ("template_contract",
                                     &pd->template_contract),
       GNUNET_PQ_result_spec_end
     };
@@ -9551,7 +9553,7 @@ postgres_connect (void *cls)
                             "     (SELECT merchant_serial "
                             "        FROM merchant_instances"
                             "        WHERE merchant_id=$1)"
-                            "   AND merchant_template.template_id=$2"
+                            "   AND merchant_template.template_id=$2"),
     /* for postgres_insert_template() */
     GNUNET_PQ_make_prepare ("insert_template",
                             "INSERT INTO merchant_template"
@@ -9575,7 +9577,7 @@ postgres_connect (void *cls)
                             "   (SELECT merchant_serial"
                             "      FROM merchant_instances"
                             "      WHERE merchant_id=$1)"
-                            "   AND template_id=$2"
+                            "   AND template_id=$2"),
     GNUNET_PQ_PREPARED_STATEMENT_END
   };
   struct GNUNET_PQ_ExecuteStatement es[] = {
@@ -9591,7 +9593,7 @@ postgres_connect (void *cls)
   if (NULL == pg->conn)
     return GNUNET_SYSERR;
   return GNUNET_OK;
-}
+  };
 
 
 /**
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
index 19005d41..d1510aa8 100644
--- a/src/backenddb/test_merchantdb.c
+++ b/src/backenddb/test_merchantdb.c
@@ -6890,6 +6890,8 @@ run (void *cls)
 
   result = run_tests ();
   if (0 == result)
+    /*   result = run_template_tests ();
+         if (0 == result)*/
   {
     /* Test dropping tables */
     if (GNUNET_OK != plugin->drop_tables (plugin->cls))
@@ -6952,4 +6954,7 @@ main (int argc,
 }
 
 
+
+
+
 /* end of test_merchantdb.c */

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