gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated (2a52426a -> 1d5bd199)


From: gnunet
Subject: [taler-merchant] branch master updated (2a52426a -> 1d5bd199)
Date: Mon, 20 Feb 2023 18:19:44 +0100

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

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

    from 2a52426a preparations to store AML decision if any is returned by the 
exchange, incomplete, not really used
     new 69341625 pull changes
     new 83c11d74 pull changes
     new 1eda15ed fix crash in test logic due to off by 1
     new 1d4d3feb fix memory leak on exceptional code path
     new 1d5bd199 allow pos_key being NULL

The 5 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:
 .../taler-merchant-httpd_post-orders-ID-pay.c      |  1 +
 ...taler-merchant-httpd_private-get-templates-ID.c |  6 +++---
 ...ler-merchant-httpd_private-patch-templates-ID.c | 14 ++-----------
 .../taler-merchant-httpd_private-post-templates.c  | 23 +++++++--------------
 src/backenddb/merchant-0004.sql                    |  6 +++---
 src/backenddb/merchantdb_helper.c                  |  2 +-
 src/backenddb/plugin_merchantdb_postgres.c         | 20 +++++++++---------
 src/backenddb/test_merchantdb.c                    | 14 ++++++-------
 src/include/taler_merchant_testing_lib.h           |  2 +-
 src/include/taler_merchantdb_plugin.h              |  4 ++--
 src/lib/merchant_api_get_template.c                |  8 ++++----
 src/lib/merchant_api_patch_template.c              |  6 +++---
 src/lib/merchant_api_post_templates.c              |  6 +++---
 src/testing/testing_api_cmd_get_template.c         | 24 +++++++++++-----------
 src/testing/testing_api_cmd_patch_template.c       | 16 +++++++--------
 src/testing/testing_api_cmd_post_templates.c       | 16 +++++++--------
 src/testing/testing_api_cmd_testserver.c           |  2 +-
 17 files changed, 76 insertions(+), 94 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c 
b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
index 41b526c9..e9f7895d 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -2310,6 +2310,7 @@ parse_pay (struct PayContext *pc)
                            &pc->dc[j].cdd.coin_pub))
         {
           GNUNET_break_op (0);
+          GNUNET_JSON_parse_free (spec);
           return (MHD_YES ==
                   TALER_MHD_reply_with_error (pc->connection,
                                               MHD_HTTP_BAD_REQUEST,
diff --git a/src/backend/taler-merchant-httpd_private-get-templates-ID.c 
b/src/backend/taler-merchant-httpd_private-get-templates-ID.c
index 953582ca..f15a03f8 100644
--- a/src/backend/taler-merchant-httpd_private-get-templates-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-templates-ID.c
@@ -69,12 +69,12 @@ TMH_private_get_templates_ID (const struct 
TMH_RequestHandler *rh,
       GNUNET_JSON_pack_string ("template_description",
                                tp.template_description),
       GNUNET_JSON_pack_allow_null (
-        GNUNET_JSON_pack_string ("image",
-                                 tp.image)),
+        GNUNET_JSON_pack_string ("pos_key",
+                                 tp.pos_key)),
       GNUNET_JSON_pack_object_steal ("template_contract",
                                      tp.template_contract));
     GNUNET_free (tp.template_description);
-    GNUNET_free (tp.image);
+    GNUNET_free (tp.pos_key);
 
     return ret;
   }
diff --git a/src/backend/taler-merchant-httpd_private-patch-templates-ID.c 
b/src/backend/taler-merchant-httpd_private-patch-templates-ID.c
index b1116f62..57c6dd95 100644
--- a/src/backend/taler-merchant-httpd_private-patch-templates-ID.c
+++ b/src/backend/taler-merchant-httpd_private-patch-templates-ID.c
@@ -113,8 +113,8 @@ TMH_private_patch_templates_ID (const struct 
TMH_RequestHandler *rh,
     GNUNET_JSON_spec_string ("template_description",
                              (const char **) &tp.template_description),
     GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_string ("image",
-                               (const char **) &tp.image),
+      GNUNET_JSON_spec_string ("pos_key",
+                               (const char **) &tp.pos_key),
       NULL),
     GNUNET_JSON_spec_json ("template_contract",
                            &tp.template_contract),
@@ -145,16 +145,6 @@ TMH_private_patch_templates_ID (const struct 
TMH_RequestHandler *rh,
                                        "template_contract");
   }
 
-    if ((NULL != tp.image) && (! TMH_image_data_url_valid (tp.image)))
-  {
-    GNUNET_break_op (0);
-    GNUNET_JSON_parse_free (spec);
-    return TALER_MHD_reply_with_error (connection,
-                                       MHD_HTTP_BAD_REQUEST,
-                                       TALER_EC_GENERIC_PARAMETER_MALFORMED,
-                                       "image");
-  }
-
   qs = TMH_db->update_template (TMH_db->cls,
                                mi->settings.id,
                                template_id,
diff --git a/src/backend/taler-merchant-httpd_private-post-templates.c 
b/src/backend/taler-merchant-httpd_private-post-templates.c
index 9cc33eaa..ac2a9206 100644
--- a/src/backend/taler-merchant-httpd_private-post-templates.c
+++ b/src/backend/taler-merchant-httpd_private-post-templates.c
@@ -47,10 +47,12 @@ templates_equal (const struct 
TALER_MERCHANTDB_TemplateDetails *t1,
 {
   return ( (0 == strcmp (t1->template_description,
                          t2->template_description)) &&
-           ( ( (NULL == t1->image) && (NULL == t2->image) ) ||
-             ( (NULL != t1->image) && (NULL != t2->image) &&
-               (0 == strcmp (t1->image,
-                             t2->image)) ) ) &&
+           ( ( (NULL == t1->pos_key) &&
+               (NULL == t2->pos_key) ) ||
+             ( (NULL != t1->pos_key) &&
+               (NULL != t2->pos_key) &&
+               (0 == strcmp (t1->pos_key,
+                             t2->pos_key))) ) &&
            (1 == json_equal (t1->template_contract,
                              t2->template_contract)) );
 }
@@ -72,7 +74,7 @@ TMH_private_post_templates (const struct TMH_RequestHandler 
*rh,
                              (const char **) &tp.template_description),
     GNUNET_JSON_spec_mark_optional( 
       GNUNET_JSON_spec_string ("image",
-                               (const char **) &tp.image),
+                               (const char **) &tp.pos_key),
       NULL),
     GNUNET_JSON_spec_json ("template_contract",
                            &tp.template_contract),
@@ -107,17 +109,6 @@ TMH_private_post_templates (const struct 
TMH_RequestHandler *rh,
                                        "template_contract");
   }
 
-  if ( (NULL != tp.image) &&
-       (! TMH_image_data_url_valid (tp.image)) )
-  {
-    GNUNET_break_op (0);
-    GNUNET_JSON_parse_free (spec);
-    return TALER_MHD_reply_with_error (connection,
-                                       MHD_HTTP_BAD_REQUEST,
-                                       TALER_EC_GENERIC_PARAMETER_MALFORMED,
-                                       "image");
-  }
-
   /* finally, interact with DB until no serialization error */
   for (unsigned int i = 0; i<MAX_RETRIES; i++)
   {
diff --git a/src/backenddb/merchant-0004.sql b/src/backenddb/merchant-0004.sql
index b63594ee..3864f37d 100644
--- a/src/backenddb/merchant-0004.sql
+++ b/src/backenddb/merchant-0004.sql
@@ -34,7 +34,7 @@ CREATE TABLE IF NOT EXISTS merchant_template
     REFERENCES merchant_instances (merchant_serial) ON DELETE CASCADE
   ,template_id VARCHAR NOT NULL
   ,template_description VARCHAR NOT NULL
-  ,image BYTEA
+  ,pos_key VARCHAR
   ,template_contract VARCHAR NOT NULL -- in JSON format
   ,UNIQUE (merchant_serial, template_id)
   );
@@ -42,8 +42,8 @@ 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';
-COMMENT ON COLUMN merchant_template.image
-  IS 'NOT NULL, but can be 0 bytes; must contain an ImageDataUrl';
+COMMENT ON COLUMN merchant_template.pos_key
+  IS 'A base64-encoded key of the point-of-sale. It will be use by the TOTP';
 COMMENT ON COLUMN merchant_template.template_contract
   IS 'The template contract will contains some additional information.';
 
diff --git a/src/backenddb/merchantdb_helper.c 
b/src/backenddb/merchantdb_helper.c
index 0a49f5d6..dc59572c 100644
--- a/src/backenddb/merchantdb_helper.c
+++ b/src/backenddb/merchantdb_helper.c
@@ -43,7 +43,7 @@ TALER_MERCHANTDB_template_details_free (
   struct TALER_MERCHANTDB_TemplateDetails *tp)
 {
   GNUNET_free (tp->template_description);
-  GNUNET_free (tp->image);
+  GNUNET_free (tp->pos_key);
   json_decref (tp->template_contract);
 }
 
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 9f07d3aa..836eb07a 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -6875,9 +6875,9 @@ postgres_insert_template (void *cls,
     GNUNET_PQ_query_param_string (instance_id),
     GNUNET_PQ_query_param_string (template_id),
     GNUNET_PQ_query_param_string (td->template_description),
-    (NULL == td->image)
+    (NULL == td->pos_key)
     ? GNUNET_PQ_query_param_null ()
-    : GNUNET_PQ_query_param_string (td->image),
+    : GNUNET_PQ_query_param_string (td->pos_key),
     TALER_PQ_query_param_json (td->template_contract),
     GNUNET_PQ_query_param_end
   };
@@ -6911,9 +6911,9 @@ postgres_update_template (void *cls,
     GNUNET_PQ_query_param_string (instance_id),
     GNUNET_PQ_query_param_string (template_id),
     GNUNET_PQ_query_param_string (td->template_description),
-    (NULL == td->image)
+    (NULL == td->pos_key)
     ? GNUNET_PQ_query_param_null ()
-    : GNUNET_PQ_query_param_string (td->image),
+    : GNUNET_PQ_query_param_string (td->pos_key),
     TALER_PQ_query_param_json (td->template_contract),
     GNUNET_PQ_query_param_end
   };
@@ -7074,8 +7074,8 @@ postgres_lookup_template (void *cls,
       GNUNET_PQ_result_spec_string ("template_description",
                                     &td->template_description),
       GNUNET_PQ_result_spec_allow_null (
-        GNUNET_PQ_result_spec_string ("image",
-                                      &td->image),
+        GNUNET_PQ_result_spec_string ("pos_key",
+                                      &td->pos_key),
         NULL),
       TALER_PQ_result_spec_json ("template_contract",
                                  &td->template_contract),
@@ -7083,7 +7083,7 @@ postgres_lookup_template (void *cls,
     };
 
     check_connection (pg);
-    td->image = NULL;
+    td->pos_key = NULL;
     return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
                                                      "lookup_template",
                                                      params,
@@ -10274,7 +10274,7 @@ postgres_connect (void *cls)
     GNUNET_PQ_make_prepare ("lookup_template",
                             "SELECT"
                             " template_description"
-                            ",image"
+                            ",pos_key"
                             ",template_contract"
                             " FROM merchant_template"
                             " JOIN merchant_instances"
@@ -10296,7 +10296,7 @@ postgres_connect (void *cls)
                             "(merchant_serial"
                             ",template_id"
                             ",template_description"
-                            ",image"
+                            ",pos_key"
                             ",template_contract"
                             ")"
                             " SELECT merchant_serial,"
@@ -10307,7 +10307,7 @@ postgres_connect (void *cls)
     GNUNET_PQ_make_prepare ("update_template",
                             "UPDATE merchant_template SET"
                             " template_description=$3"
-                            ",image=$4"
+                            ",pos_key=$4"
                             ",template_contract=$5"
                             " WHERE merchant_serial="
                             "   (SELECT merchant_serial"
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
index 346a5427..5a84e8b2 100644
--- a/src/backenddb/test_merchantdb.c
+++ b/src/backenddb/test_merchantdb.c
@@ -6875,7 +6875,7 @@ make_template (const char *id,
 {
   template->id = id;
   template->template.template_description = "This is a test template";
-  template->template.image = NULL;
+  template->template.pos_key = NULL;
   template->template.template_contract = json_array ();
   GNUNET_assert (NULL != template->template.template_contract);
 }
@@ -6889,7 +6889,7 @@ make_template (const char *id,
 static void
 free_template_data (struct TemplateData *template)
 {
-  GNUNET_free (template->template.image);
+  GNUNET_free (template->template.pos_key);
   json_decref (template->template.template_contract);
 }
 
@@ -6907,9 +6907,9 @@ check_templates_equal (const struct 
TALER_MERCHANTDB_TemplateDetails *a,
 {
   if ((0 != strcmp (a->template_description,
                     b->template_description)) ||
-      ( (NULL == a->image) && (NULL != b->image)) ||
-      ( (NULL != a->image) && (NULL == b->image)) ||
-      ( (NULL != a->image) && (0 != strcmp (a->image, b->image))) ||
+      ( (NULL == a->pos_key) && (NULL != b->pos_key)) ||
+      ( (NULL != a->pos_key) && (NULL == b->pos_key)) ||
+      ( (NULL != a->pos_key) && (0 != strcmp (a->pos_key, b->pos_key))) ||
       (1 != json_equal (a->template_contract,
                         b->template_contract)))
     return 1;
@@ -7220,8 +7220,8 @@ run_test_templates (struct TestTemplates_Closure *cls)
   /* Test template update */
   cls->templates[0].template.template_description =
     "This is a test template that has been updated!";
-  GNUNET_free (cls->templates[0].template.image);
-  cls->templates[0].template.image = GNUNET_strdup ("image");
+  GNUNET_free (cls->templates[0].template.pos_key);
+  cls->templates[0].template.pos_key = GNUNET_strdup ("pos_key");
   GNUNET_assert (0 ==
                  json_array_append_new (
                    cls->templates[0].template.template_contract,
diff --git a/src/include/taler_merchant_testing_lib.h 
b/src/include/taler_merchant_testing_lib.h
index 1039d2ef..02f386c4 100644
--- a/src/include/taler_merchant_testing_lib.h
+++ b/src/include/taler_merchant_testing_lib.h
@@ -1866,7 +1866,7 @@ TALER_TESTING_cmd_checkserver2 (const char *label,
   op (h_wire, const struct TALER_MerchantWireHashP) \
   op (proposal_reference, const char *) \
   op (template_description, const char *) \
-  op (template_image, const char *) \
+  op (template_pos_key, const char *) \
   op (template_id, const char *) \
   op (template_contract, const json_t) \
   op (event_type, const char *)   \
diff --git a/src/include/taler_merchantdb_plugin.h 
b/src/include/taler_merchantdb_plugin.h
index 4168fffc..dc44ba86 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -327,9 +327,9 @@ struct TALER_MERCHANTDB_TemplateDetails
   char *template_description;
 
   /**
-   * Base64-encoded image, or NULL.
+   * Base64-encoded key, or NULL.
    */
-  char *image;
+  char *pos_key;
 
   /**
    * In this template contract, we can have additional information.
diff --git a/src/lib/merchant_api_get_template.c 
b/src/lib/merchant_api_get_template.c
index 920333b6..3edb98a1 100644
--- a/src/lib/merchant_api_get_template.c
+++ b/src/lib/merchant_api_get_template.c
@@ -93,15 +93,15 @@ handle_get_template_finished (void *cls,
   case MHD_HTTP_OK:
     {
       const char *template_description;
-      const char *image;
+      const char *pos_key;
       json_t *template_contract;
       bool rst_ok = true;
       struct GNUNET_JSON_Specification spec[] = {
         GNUNET_JSON_spec_string ("template_description",
                                  &template_description),
         GNUNET_JSON_spec_mark_optional (
-          GNUNET_JSON_spec_string ("image",
-                                   &image),
+          GNUNET_JSON_spec_string ("pos_key",
+                                   &pos_key),
           NULL),
         GNUNET_JSON_spec_json ("template_contract",
                                &template_contract),
@@ -118,7 +118,7 @@ handle_get_template_finished (void *cls,
         tgh->cb (tgh->cb_cls,
                  &hr,
                  template_description,
-                 image,
+                 pos_key,
                  template_contract);
         GNUNET_JSON_parse_free (spec);
         TALER_MERCHANT_template_get_cancel (tgh);
diff --git a/src/lib/merchant_api_patch_template.c 
b/src/lib/merchant_api_patch_template.c
index 44357cc0..5034101d 100644
--- a/src/lib/merchant_api_patch_template.c
+++ b/src/lib/merchant_api_patch_template.c
@@ -162,7 +162,7 @@ TALER_MERCHANT_template_patch (
   const char *backend_url,
   const char *template_id,
   const char *template_description,
-  const char *image,
+  const char *pos_key,
   json_t *template_contract,
   TALER_MERCHANT_TemplatePatchCallback cb,
   void *cb_cls)
@@ -174,8 +174,8 @@ TALER_MERCHANT_template_patch (
     GNUNET_JSON_pack_string ("template_description",
                              template_description),
     GNUNET_JSON_pack_allow_null (
-      GNUNET_JSON_pack_string ("image",
-                               image)),
+      GNUNET_JSON_pack_string ("pos_key",
+                               pos_key)),
     GNUNET_JSON_pack_object_incref ("template_contract",
                                     (json_t *) template_contract));
   tph = GNUNET_new (struct TALER_MERCHANT_TemplatePatchHandle);
diff --git a/src/lib/merchant_api_post_templates.c 
b/src/lib/merchant_api_post_templates.c
index 9592a5e3..735368db 100644
--- a/src/lib/merchant_api_post_templates.c
+++ b/src/lib/merchant_api_post_templates.c
@@ -199,7 +199,7 @@ TALER_MERCHANT_templates_post (
   const char *backend_url,
   const char *template_id,
   const char *template_description,
-  const char *image,
+  const char *pos_key,
   const json_t *template_contract,
   TALER_MERCHANT_TemplatesPostCallback cb,
   void *cb_cls)
@@ -218,8 +218,8 @@ TALER_MERCHANT_templates_post (
     GNUNET_JSON_pack_string ("template_description",
                              template_description),
     GNUNET_JSON_pack_allow_null (
-      GNUNET_JSON_pack_string ("image",
-                               image)),
+      GNUNET_JSON_pack_string ("pos_key",
+                               pos_key)),
     GNUNET_JSON_pack_object_incref ("template_contract",
                                     (json_t *) template_contract));
   tph = GNUNET_new (struct TALER_MERCHANT_TemplatesPostHandle);
diff --git a/src/testing/testing_api_cmd_get_template.c 
b/src/testing/testing_api_cmd_get_template.c
index bd9afff3..acd9a2e3 100644
--- a/src/testing/testing_api_cmd_get_template.c
+++ b/src/testing/testing_api_cmd_get_template.c
@@ -80,7 +80,7 @@ static void
 get_template_cb (void *cls,
                  const struct TALER_MERCHANT_HttpResponse *hr,
                  const char *template_description,
-                 const char *image,
+                 const char *pos_key,
                  const json_t *template_contract)
 {
   struct GetTemplateState *gis = cls;
@@ -120,22 +120,22 @@ get_template_cb (void *cls,
       }
     }
     {
-      const char **expected_image;
+      const char **expected_pos_key;
 
       if (GNUNET_OK !=
-          TALER_TESTING_get_trait_template_image (template_cmd,
-                                                  &expected_image))
+          TALER_TESTING_get_trait_template_pos_key (template_cmd,
+                                                    &expected_pos_key))
         TALER_TESTING_interpreter_fail (gis->is);
-      if ( ( (NULL == image) && (NULL != *expected_image)) ||
-           ( (NULL != image) && (NULL == *expected_image)) ||
-           ( (NULL != image) &&
-             (0 != strcmp (image,
-                           *expected_image)) ) )
+      if ( ( (NULL == pos_key) && (NULL != *expected_pos_key)) ||
+           ( (NULL != pos_key) && (NULL == *expected_pos_key)) ||
+           ( (NULL != pos_key) &&
+             (0 != strcmp (pos_key,
+                           *expected_pos_key)) ) )
       {
         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Template image `%s' does not match `%s'\n",
-                    image,
-                    *expected_image);
+                    "Template pos_key `%s' does not match `%s'\n",
+                    pos_key,
+                    *expected_pos_key);
         TALER_TESTING_interpreter_fail (gis->is);
         return;
       }
diff --git a/src/testing/testing_api_cmd_patch_template.c 
b/src/testing/testing_api_cmd_patch_template.c
index a2a75b89..f6f5771b 100644
--- a/src/testing/testing_api_cmd_patch_template.c
+++ b/src/testing/testing_api_cmd_patch_template.c
@@ -60,9 +60,9 @@ struct PatchTemplateState
   const char *template_description;
 
   /**
-   * base64-encoded template image
+   * base64-encoded key
    */
-  char *image;
+  char *pos_key;
 
   /**
    * Contract of the company
@@ -141,7 +141,7 @@ patch_template_run (void *cls,
                                            pis->merchant_url,
                                            pis->template_id,
                                            pis->template_description,
-                                           pis->image,
+                                           pis->pos_key,
                                            pis->template_contract,
                                            &patch_template_cb,
                                            pis);
@@ -168,8 +168,8 @@ patch_template_traits (void *cls,
   struct PatchTemplateState *pts = cls;
   struct TALER_TESTING_Trait traits[] = {
     TALER_TESTING_make_trait_template_description (&pts->template_description),
-    TALER_TESTING_make_trait_template_image (
-      (const char **) &pts->image),
+    TALER_TESTING_make_trait_template_pos_key (
+      (const char **) &pts->pos_key),
     TALER_TESTING_make_trait_template_contract (pts->template_contract),
     TALER_TESTING_make_trait_template_id (&pts->template_id),
     TALER_TESTING_trait_end (),
@@ -201,7 +201,7 @@ patch_template_cleanup (void *cls,
                 "PATCH /templates/$ID operation did not complete\n");
     TALER_MERCHANT_template_patch_cancel (pis->iph);
   }
-  GNUNET_free (pis->image);
+  GNUNET_free (pis->pos_key);
   json_decref (pis->template_contract);
   GNUNET_free (pis);
 }
@@ -213,7 +213,7 @@ TALER_TESTING_cmd_merchant_patch_template (
   const char *merchant_url,
   const char *template_id,
   const char *template_description,
-  const char *image,
+  const char *pos_key,
   json_t *template_contract,
   unsigned int http_status)
 {
@@ -224,7 +224,7 @@ TALER_TESTING_cmd_merchant_patch_template (
   pis->template_id = template_id;
   pis->http_status = http_status;
   pis->template_description = template_description;
-  pis->image = (NULL == image) ? NULL : GNUNET_strdup (image);
+  pis->pos_key = (NULL == pos_key) ? NULL : GNUNET_strdup (pos_key);
   pis->template_contract = template_contract; /* ownership taken */
   {
     struct TALER_TESTING_Command cmd = {
diff --git a/src/testing/testing_api_cmd_post_templates.c 
b/src/testing/testing_api_cmd_post_templates.c
index 32b8d627..434ddb96 100644
--- a/src/testing/testing_api_cmd_post_templates.c
+++ b/src/testing/testing_api_cmd_post_templates.c
@@ -60,9 +60,9 @@ struct PostTemplatesState
   const char *template_description;
 
   /**
-   * base64-encoded product image
+   * base64-encoded key
    */
-  char *image;
+  char *pos_key;
 
   /**
    * Contract of the company
@@ -140,7 +140,7 @@ post_templates_run (void *cls,
                                             tis->merchant_url,
                                             tis->template_id,
                                             tis->template_description,
-                                            tis->image,
+                                            tis->pos_key,
                                             tis->template_contract,
                                             &post_templates_cb,
                                             tis);
@@ -172,8 +172,8 @@ post_templates_traits (void *cls,
   struct PostTemplatesState *pts = cls;
   struct TALER_TESTING_Trait traits[] = {
     TALER_TESTING_make_trait_template_description (&pts->template_description),
-    TALER_TESTING_make_trait_template_image (
-      (const char **) &pts->image),
+    TALER_TESTING_make_trait_template_pos_key (
+      (const char **) &pts->pos_key),
     TALER_TESTING_make_trait_template_contract (pts->template_contract),
     TALER_TESTING_make_trait_template_id (&pts->template_id),
     TALER_TESTING_trait_end (),
@@ -205,7 +205,7 @@ post_templates_cleanup (void *cls,
                 "POST /templates operation did not complete\n");
     TALER_MERCHANT_templates_post_cancel (tis->iph);
   }
-  GNUNET_free (tis->image);
+  GNUNET_free (tis->pos_key);
   json_decref (tis->template_contract);
   GNUNET_free (tis);
 }
@@ -217,7 +217,7 @@ TALER_TESTING_cmd_merchant_post_templates2 (
   const char *merchant_url,
   const char *template_id,
   const char *template_description,
-  const char *image,
+  const char *pos_key,
   json_t *template_contract,
   unsigned int http_status)
 {
@@ -231,7 +231,7 @@ TALER_TESTING_cmd_merchant_post_templates2 (
   tis->template_id = template_id;
   tis->http_status = http_status;
   tis->template_description = template_description;
-  tis->image = (NULL == image) ? NULL : GNUNET_strdup (image);
+  tis->pos_key = (NULL == pos_key) ? NULL : GNUNET_strdup (pos_key);
   tis->template_contract = template_contract;
   {
     struct TALER_TESTING_Command cmd = {
diff --git a/src/testing/testing_api_cmd_testserver.c 
b/src/testing/testing_api_cmd_testserver.c
index c5a929c0..5d0a5ad6 100644
--- a/src/testing/testing_api_cmd_testserver.c
+++ b/src/testing/testing_api_cmd_testserver.c
@@ -276,7 +276,7 @@ testserver_cleanup (void *cls,
   struct TestserverState *ser = cls;
 
   (void) cmd;
-  for (unsigned int i = 0; i<ser->rcs_length - 1; i++)
+  for (unsigned int i = 0; i<ser->rcs_length; i++)
   {
     struct RequestCtx *rc = ser->rcs[i];
 

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