gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: remove dead ps passing for trut


From: gnunet
Subject: [taler-anastasis] branch master updated: remove dead ps passing for truth upload
Date: Wed, 17 Mar 2021 22:58:41 +0100

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

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 0d29d0f  remove dead ps passing for truth upload
0d29d0f is described below

commit 0d29d0f0ca6439cc1544e507dd4cba37a6293ea4
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Wed Mar 17 22:58:37 2021 +0100

    remove dead ps passing for truth upload
---
 src/backend/anastasis-httpd_truth_upload.c | 29 +++++++++--
 src/include/anastasis.h                    | 70 ++++++++++++-------------
 src/include/anastasis_service.h            |  2 -
 src/include/anastasis_testing_lib.h        |  4 --
 src/lib/anastasis_backup.c                 |  6 ---
 src/reducer/anastasis_api_backup_redux.c   | 82 ++++++++++--------------------
 src/restclient/anastasis_api_truth_store.c | 12 -----
 src/testing/test_anastasis.c               |  3 --
 src/testing/testing_api_cmd_truth_store.c  | 24 ---------
 src/testing/testing_cmd_truth_upload.c     | 39 --------------
 10 files changed, 82 insertions(+), 189 deletions(-)

diff --git a/src/backend/anastasis-httpd_truth_upload.c 
b/src/backend/anastasis-httpd_truth_upload.c
index 1082fe8..80bd2f5 100644
--- a/src/backend/anastasis-httpd_truth_upload.c
+++ b/src/backend/anastasis-httpd_truth_upload.c
@@ -192,6 +192,9 @@ make_payment_request (struct TruthUploadContext *tuc)
                        hn,
                        order_id);
       GNUNET_free (order_id);
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "Returning 402  %s\n",
+                  order_id);
     }
     GNUNET_break (MHD_YES ==
                   MHD_add_response_header (resp,
@@ -268,6 +271,9 @@ check_payment_cb (void *cls,
   struct TruthUploadContext *tuc = cls;
 
   tuc->cpo = NULL;
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+              "Checking backend order status returned %u\n",
+              hr->http_status);
   switch (hr->http_status)
   {
   case 0:
@@ -296,7 +302,7 @@ check_payment_cb (void *cls,
           break;
         }
       }
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   "Payment confirmed, resuming upload\n");
       break;
     case TALER_MERCHANT_OSC_UNPAID:
@@ -332,6 +338,9 @@ check_payment_cb (void *cls,
       order_id = GNUNET_STRINGS_data_to_string_alloc (
         &tuc->truth_uuid,
         sizeof(tuc->truth_uuid));
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "404, setting up fresh order %s\n",
+                  order_id);
       order = json_pack ("{s:o, s:s, s:s}",
                          "amount",
                          TALER_JSON_from_amount (&AH_truth_upload_fee),
@@ -395,6 +404,8 @@ begin_payment (struct TruthUploadContext *tuc)
   char *order_id;
   struct GNUNET_TIME_Relative timeout;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+              "Checking backend order status...\n");
   timeout = GNUNET_TIME_absolute_get_remaining (tuc->timeout);
   order_id = GNUNET_STRINGS_data_to_string_alloc (
     &tuc->truth_uuid,
@@ -551,7 +562,8 @@ AH_handler_truth_post (
               GNUNET_TIME_absolute_get_remaining (paid_until).rel_value_us) )
         {
           GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                      "TRUTH payment require!\n");
+                      "TRUTH payment required (%d)!\n",
+                      qs);
           return begin_payment (tuc);
         }
         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -566,10 +578,8 @@ AH_handler_truth_post (
 
   if (NULL != tuc->resp)
   {
-    MHD_RESULT ret;
-
     /* We generated a response asynchronously, queue that */
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Returning asynchronously generated response with HTTP status 
%u\n",
                 tuc->response_code);
     ret = MHD_queue_response (connection,
@@ -587,7 +597,10 @@ AH_handler_truth_post (
                                    truth_data_size,
                                    &json);
   if (GNUNET_SYSERR == res)
+  {
+    GNUNET_break (0);
     return MHD_NO;
+  }
   if ( (GNUNET_NO == res) ||
        (NULL == json) )
     return MHD_YES;
@@ -595,7 +608,10 @@ AH_handler_truth_post (
                                    json,
                                    spec);
   if (GNUNET_SYSERR == res)
+  {
+    GNUNET_break (0);
     return MHD_NO;   /* hard failure */
+  }
   if (GNUNET_NO == res)
     return MHD_YES;   /* failure */
 
@@ -618,6 +634,8 @@ AH_handler_truth_post (
     }
   }
 
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+              "Storing truth!\n");
   qs = db->store_truth (db->cls,
                         truth_uuid,
                         &keyshare_data,
@@ -654,6 +672,7 @@ AH_handler_truth_post (
                                 MHD_HTTP_NO_CONTENT,
                                 resp);
       MHD_destroy_response (resp);
+      GNUNET_break (MHD_YES == ret);
       return ret;
     }
   }
diff --git a/src/include/anastasis.h b/src/include/anastasis.h
index 633c995..384844b 100644
--- a/src/include/anastasis.h
+++ b/src/include/anastasis.h
@@ -584,27 +584,25 @@ typedef void
  * @param truth_data contains the truth for this challenge i.e. phone number, 
email address
  * @param truth_data_size size of the data
  * @param payment_requested true if the client wants to pay more for the 
account now
- * @param paid_order_id payment identifier of last payment
  * @param pay_timeout how long to wait for payment
  * @param tc opens the truth callback which contains the status of the upload
  * @param tc_cls closure for the callback
  */
 struct ANASTASIS_TruthUpload *
-ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
-                        const struct ANASTASIS_CRYPTO_UserIdentifierP *user_id,
-                        const char *provider_url,
-                        const char *type,
-                        const char *instructions,
-                        const char *mime_type,
-                        const struct
-                        ANASTASIS_CRYPTO_ProviderSaltP *provider_salt,
-                        const void *truth_data,
-                        size_t truth_data_size,
-                        bool payment_requested,
-                        const struct ANASTASIS_PaymentSecretP *paid_order_id,
-                        struct GNUNET_TIME_Relative pay_timeout,
-                        ANASTASIS_TruthCallback tc,
-                        void *tc_cls);
+ANASTASIS_truth_upload (
+  struct GNUNET_CURL_Context *ctx,
+  const struct ANASTASIS_CRYPTO_UserIdentifierP *user_id,
+  const char *provider_url,
+  const char *type,
+  const char *instructions,
+  const char *mime_type,
+  const struct ANASTASIS_CRYPTO_ProviderSaltP *provider_salt,
+  const void *truth_data,
+  size_t truth_data_size,
+  bool payment_requested,
+  struct GNUNET_TIME_Relative pay_timeout,
+  ANASTASIS_TruthCallback tc,
+  void *tc_cls);
 
 
 /**
@@ -621,7 +619,6 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
  * @param truth_data contains the truth for this challenge i.e. phone number, 
email address
  * @param truth_data_size size of the data
  * @param payment_requested true if the client wants to pay more for the 
account now
- * @param paid_order_id payment identifier of last payment
  * @param pay_timeout how long to wait for payment
  * @param uuid truth UUID to use
  * @param salt salt to use to hash security questions
@@ -631,25 +628,24 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
  * @param tc_cls closure for the callback
  */
 struct ANASTASIS_TruthUpload *
-ANASTASIS_truth_upload2 (struct GNUNET_CURL_Context *ctx,
-                         const struct ANASTASIS_CRYPTO_UserIdentifierP 
*user_id,
-                         const char *provider_url,
-                         const char *type,
-                         const char *instructions,
-                         const char *mime_type,
-                         const struct
-                         ANASTASIS_CRYPTO_ProviderSaltP *provider_salt,
-                         const void *truth_data,
-                         size_t truth_data_size,
-                         bool payment_requested,
-                         const struct ANASTASIS_PaymentSecretP *paid_order_id,
-                         struct GNUNET_TIME_Relative pay_timeout,
-                         const struct ANASTASIS_CRYPTO_TruthUUIDP *uuid,
-                         const struct ANASTASIS_CRYPTO_QuestionSaltP *salt,
-                         const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key,
-                         const struct ANASTASIS_CRYPTO_KeyShareP *key_share,
-                         ANASTASIS_TruthCallback tc,
-                         void *tc_cls);
+ANASTASIS_truth_upload2 (
+  struct GNUNET_CURL_Context *ctx,
+  const struct ANASTASIS_CRYPTO_UserIdentifierP *user_id,
+  const char *provider_url,
+  const char *type,
+  const char *instructions,
+  const char *mime_type,
+  const struct ANASTASIS_CRYPTO_ProviderSaltP *provider_salt,
+  const void *truth_data,
+  size_t truth_data_size,
+  bool payment_requested,
+  struct GNUNET_TIME_Relative pay_timeout,
+  const struct ANASTASIS_CRYPTO_TruthUUIDP *uuid,
+  const struct ANASTASIS_CRYPTO_QuestionSaltP *salt,
+  const struct ANASTASIS_CRYPTO_TruthKeyP *truth_key,
+  const struct ANASTASIS_CRYPTO_KeyShareP *key_share,
+  ANASTASIS_TruthCallback tc,
+  void *tc_cls);
 
 
 /**
@@ -663,7 +659,6 @@ ANASTASIS_truth_upload2 (struct GNUNET_CURL_Context *ctx,
  * @param truth_data contains the truth for this challenge i.e. phone number, 
email address
  * @param truth_data_size size of the data
  * @param payment_requested true if the client wants to pay more for the 
account now
- * @param paid_order_id payment identifier of last payment
  * @param pay_timeout how long to wait for payment
  * @param tc opens the truth callback which contains the status of the upload
  * @param tc_cls closure for the callback
@@ -675,7 +670,6 @@ ANASTASIS_truth_upload3 (struct GNUNET_CURL_Context *ctx,
                          const void *truth_data,
                          size_t truth_data_size,
                          bool payment_requested,
-                         const struct ANASTASIS_PaymentSecretP *paid_order_id,
                          struct GNUNET_TIME_Relative pay_timeout,
                          ANASTASIS_TruthCallback tc,
                          void *tc_cls);
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index 0c1d592..715c7c0 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -638,7 +638,6 @@ typedef void
  * @param encrypted_truth_size number of bytes in @e encrypted_truth
  * @param encrypted_truth contains the @a type-specific authorization data
  * @param payment_requested true if we want to pay, even if not yet required
- * @param paid_order_id provides order ID of a previous payment for this 
truth, or NULL
  * @param payment_timeout how long to wait for the payment, use
  *           #GNUNET_TIME_UNIT_ZERO to let the server pick
  * @param cb callback processing the response from /truth
@@ -656,7 +655,6 @@ ANASTASIS_truth_store (
   size_t encrypted_truth_size,
   const void *encrypted_truth,
   bool payment_requested,
-  const struct ANASTASIS_PaymentSecretP *paid_order_id,
   struct GNUNET_TIME_Relative payment_timeout,
   ANASTASIS_TruthStoreCallback cb,
   void *cb_cls);
diff --git a/src/include/anastasis_testing_lib.h 
b/src/include/anastasis_testing_lib.h
index bbf8d55..7ee540f 100644
--- a/src/include/anastasis_testing_lib.h
+++ b/src/include/anastasis_testing_lib.h
@@ -586,7 +586,6 @@ ANASTASIS_TESTING_make_id_data_example (const char 
*id_data);
  * @param mime_type mime type of truth_data
  * @param truth_data some truth data (e.g. hash of answer to a secret question)
  * @param truth_data_size size of truth_data
- * @param paid_order_id already paid order ID for this truth upload, or NULL
  * @param http_status expected HTTP status
  * @param tso truth upload options
  * @param upload_ref reference to the previous upload
@@ -602,7 +601,6 @@ ANASTASIS_TESTING_cmd_truth_upload (
   const char *mime_type,
   const void *truth_data,
   size_t truth_data_size,
-  const char *paid_order_id,
   unsigned int http_status,
   enum ANASTASIS_TESTING_TruthStoreOption tso,
   const char *upload_ref);
@@ -617,7 +615,6 @@ ANASTASIS_TESTING_cmd_truth_upload (
  * @param instructions specifies what the client/user has to do
  * @param mime_type mime type of truth_data
  * @param answer the answer to the security question
- * @param paid_order_id already paid order ID for this truth upload, or NULL
  * @param http_status expected HTTP status
  * @param tso truth upload options
  * @param upload_ref reference to the previous upload
@@ -631,7 +628,6 @@ ANASTASIS_TESTING_cmd_truth_upload_question (
   const char *instructions,
   const char *mime_type,
   const void *answer,
-  const char *paid_order_ref,
   unsigned int http_status,
   enum ANASTASIS_TESTING_TruthStoreOption tso,
   const char *salt_ref);
diff --git a/src/lib/anastasis_backup.c b/src/lib/anastasis_backup.c
index 85d6cd3..d22e68a 100644
--- a/src/lib/anastasis_backup.c
+++ b/src/lib/anastasis_backup.c
@@ -248,7 +248,6 @@ ANASTASIS_truth_upload3 (struct GNUNET_CURL_Context *ctx,
                          const void *truth_data,
                          size_t truth_data_size,
                          bool payment_requested,
-                         const struct ANASTASIS_PaymentSecretP *paid_order_id,
                          struct GNUNET_TIME_Relative pay_timeout,
                          ANASTASIS_TruthCallback tc,
                          void *tc_cls)
@@ -309,7 +308,6 @@ ANASTASIS_truth_upload3 (struct GNUNET_CURL_Context *ctx,
                                    encrypted_truth_size,
                                    encrypted_truth,
                                    payment_requested,
-                                   paid_order_id,
                                    pay_timeout,
                                    &truth_store_callback,
                                    tu);
@@ -337,7 +335,6 @@ ANASTASIS_truth_upload2 (struct GNUNET_CURL_Context *ctx,
                          const void *truth_data,
                          size_t truth_data_size,
                          bool payment_requested,
-                         const struct ANASTASIS_PaymentSecretP *paid_order_id,
                          struct GNUNET_TIME_Relative pay_timeout,
                          const struct ANASTASIS_CRYPTO_TruthUUIDP *uuid,
                          const struct ANASTASIS_CRYPTO_QuestionSaltP *salt,
@@ -368,7 +365,6 @@ ANASTASIS_truth_upload2 (struct GNUNET_CURL_Context *ctx,
                                   truth_data,
                                   truth_data_size,
                                   payment_requested,
-                                  paid_order_id,
                                   pay_timeout,
                                   tc,
                                   tc_cls);
@@ -387,7 +383,6 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
                         const void *truth_data,
                         size_t truth_data_size,
                         bool payment_requested,
-                        const struct ANASTASIS_PaymentSecretP *paid_order_id,
                         struct GNUNET_TIME_Relative pay_timeout,
                         ANASTASIS_TruthCallback tc,
                         void *tc_cls)
@@ -417,7 +412,6 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
                                   truth_data,
                                   truth_data_size,
                                   payment_requested,
-                                  paid_order_id,
                                   pay_timeout,
                                   &uuid,
                                   &question_salt,
diff --git a/src/reducer/anastasis_api_backup_redux.c 
b/src/reducer/anastasis_api_backup_redux.c
index 8b2eefa..ad60901 100644
--- a/src/reducer/anastasis_api_backup_redux.c
+++ b/src/reducer/anastasis_api_backup_redux.c
@@ -1211,12 +1211,6 @@ struct TruthUpload
    */
   char *payment_request;
 
-  /**
-   * The payment secret (aka order ID) extracted from the @e payment_request.
-   * Set if @e payment_request is non-NULL.
-   */
-  struct ANASTASIS_PaymentSecretP ps;
-
   /**
    * Which policies and methods does this truth affect?
    */
@@ -1897,26 +1891,8 @@ truth_upload_cb (void *cls,
   tue->ec = ud->ec;
   if (ANASTASIS_US_PAYMENT_REQUIRED == ud->us)
   {
-    json_t *auth_methods;
-    json_t *amj;
-
     tue->payment_request = GNUNET_strdup (
       ud->details.payment.payment_request);
-    tue->ps = ud->details.payment.ps;
-
-    auth_methods = json_object_get (tue->uc->state,
-                                    "authentication_methods");
-    amj = json_array_get (auth_methods,
-                          tue->am_idx);
-    GNUNET_assert (NULL != amj);
-    GNUNET_assert (0 ==
-                   json_object_set_new (amj,
-                                        "payment_secret",
-                                        GNUNET_JSON_from_data_auto 
(&tue->ps)));
-    GNUNET_assert (0 ==
-                   json_object_set_new (amj,
-                                        "payment_request",
-                                        json_string (tue->payment_request)));
   }
   /* persist upload status for later */
   policies = json_object_get (tue->uc->state,
@@ -1955,7 +1931,6 @@ truth_upload_cb (void *cls,
  *                     the truth to, used to check for existing entries
  * @param am_idx index of the authentication method, used to check for 
existing entries
  * @param[in] truth object representing already uploaded truth, reference 
captured!
- * @param must_upload true if the upload was not yet completed and should be 
attempted
  * @param[in,out] async_truth pointer to counter with the number of ongoing 
uploads,
  *                updated
  * @param auth_method object with the challenge details, to generate the truth
@@ -1968,12 +1943,12 @@ add_truth_object (struct UploadContext *uc,
                   const char *provider_url,
                   uint32_t am_idx,
                   json_t *truth,
-                  bool must_upload,
                   unsigned int *async_truth,
                   json_t *auth_method)
 {
   /* check if we are already uploading this truth */
   struct TruthUpload *tue;
+  bool must_upload = true;
 
   for (tue = uc->tues_head;
        NULL != tue;
@@ -1990,6 +1965,7 @@ add_truth_object (struct UploadContext *uc,
     }
   }
 
+
   if (NULL == tue)
   {
     /* Create new entry */
@@ -2006,6 +1982,26 @@ add_truth_object (struct UploadContext *uc,
     tue->policies_length = 1;
   }
 
+  {
+    uint32_t status = UINT32_MAX;
+    struct GNUNET_JSON_Specification spec[] = {
+      GNUNET_JSON_spec_mark_optional (
+        GNUNET_JSON_spec_uint32 ("upload_status",
+                                 &status)),
+      GNUNET_JSON_spec_end ()
+    };
+    if (GNUNET_OK !=
+        GNUNET_JSON_parse (truth,
+                           spec,
+                           NULL, NULL))
+    {
+      GNUNET_break (0);
+      return GNUNET_SYSERR;
+    }
+
+    must_upload = (ANASTASIS_US_SUCCESS != status);
+  }
+
   if (NULL == tue->t)
   {
     tue->t = ANASTASIS_truth_from_json (truth);
@@ -2033,17 +2029,10 @@ add_truth_object (struct UploadContext *uc,
     bool force_payment = false;
     void *truth_data;
     size_t truth_data_size;
-    const char *payment_request = NULL;
     struct GNUNET_JSON_Specification spec[] = {
       GNUNET_JSON_spec_mark_optional (
         GNUNET_JSON_spec_bool ("force_pay",
                                &force_payment)),
-      GNUNET_JSON_spec_mark_optional (
-        GNUNET_JSON_spec_string ("payment_request",
-                                 &payment_request)),
-      GNUNET_JSON_spec_mark_optional (
-        GNUNET_JSON_spec_fixed_auto ("payment_secret",
-                                     &tue->ps)),
       GNUNET_JSON_spec_varsize ("challenge",
                                 &truth_data,
                                 &truth_data_size),
@@ -2089,7 +2078,6 @@ add_truth_object (struct UploadContext *uc,
                                        truth_data,
                                        truth_data_size,
                                        force_payment,
-                                       &tue->ps,
                                        uc->timeout,
                                        &truth_upload_cb,
                                        tue);
@@ -2134,6 +2122,7 @@ check_truth_upload (struct UploadContext *uc,
 {
   json_t *user_id;
   json_t *jtruth;
+  struct TruthUpload *tue;
 
   user_id = json_object_get (uc->state,
                              "identity_attributes");
@@ -2144,7 +2133,7 @@ check_truth_upload (struct UploadContext *uc,
   }
 
   /* check if we are already uploading this truth */
-  for (struct TruthUpload *tue = uc->tues_head;
+  for (tue = uc->tues_head;
        NULL != tue;
        tue = tue->next)
   {
@@ -2159,6 +2148,8 @@ check_truth_upload (struct UploadContext *uc,
     }
   }
 
+  /* need new upload */
+  tue = GNUNET_new (struct TruthUpload);
   {
     json_t *policies = json_object_get (uc->state,
                                         "policies");
@@ -2173,11 +2164,8 @@ check_truth_upload (struct UploadContext *uc,
                               "truth");
   }
 
-  /* need new upload */
   {
-    struct TruthUpload *tue = GNUNET_new (struct TruthUpload);
     const char *type;
-    const char *payment_request = NULL;
     const char *mime_type = NULL;
     const char *instructions = NULL;
     bool force_payment = false;
@@ -2195,12 +2183,6 @@ check_truth_upload (struct UploadContext *uc,
       GNUNET_JSON_spec_mark_optional (
         GNUNET_JSON_spec_string ("instructions",
                                  &instructions)),
-      GNUNET_JSON_spec_mark_optional (
-        GNUNET_JSON_spec_string ("payment_request",
-                                 &payment_request)),
-      GNUNET_JSON_spec_mark_optional (
-        GNUNET_JSON_spec_fixed_auto ("payment_secret",
-                                     &tue->ps)),
       GNUNET_JSON_spec_varsize ("challenge",
                                 &truth_data,
                                 &truth_data_size),
@@ -2275,9 +2257,6 @@ check_truth_upload (struct UploadContext *uc,
                                           truth_data,
                                           truth_data_size,
                                           force_payment,
-                                          (NULL != payment_request)
-                                          ? &tue->ps
-                                          : NULL,
                                           uc->timeout,
                                           &truth_upload_cb,
                                           tue);
@@ -2294,9 +2273,6 @@ check_truth_upload (struct UploadContext *uc,
                                            truth_data,
                                            truth_data_size,
                                            force_payment,
-                                           (NULL != payment_request)
-                                          ? &tue->ps
-                                          : NULL,
                                            uc->timeout,
                                            &uuid,
                                            &question_salt,
@@ -2425,15 +2401,11 @@ upload (json_t *state,
         uint32_t am_idx;
         const char *provider_url;
         json_t *truth = NULL;
-        uint32_t status = UINT32_MAX;
         struct GNUNET_JSON_Specification spec[] = {
           GNUNET_JSON_spec_string ("provider",
                                    &provider_url),
           GNUNET_JSON_spec_uint32 ("authentication_method",
                                    &am_idx),
-          GNUNET_JSON_spec_mark_optional (
-            GNUNET_JSON_spec_uint32 ("upload_status",
-                                     &status)),
           GNUNET_JSON_spec_mark_optional (
             GNUNET_JSON_spec_json ("truth",
                                    &truth)),
@@ -2495,14 +2467,12 @@ upload (json_t *state,
           else
           {
             int ret;
-            bool must_upload = (ANASTASIS_US_SUCCESS != status);
 
             ret = add_truth_object (uc,
                                     &pmr,
                                     provider_url,
                                     am_idx,
                                     truth,
-                                    must_upload,
                                     &async_truth,
                                     amj);
             if (GNUNET_SYSERR == ret)
diff --git a/src/restclient/anastasis_api_truth_store.c 
b/src/restclient/anastasis_api_truth_store.c
index bc4d2ce..b385c63 100644
--- a/src/restclient/anastasis_api_truth_store.c
+++ b/src/restclient/anastasis_api_truth_store.c
@@ -249,7 +249,6 @@ ANASTASIS_truth_store (
   size_t encrypted_truth_size,
   const void *encrypted_truth,
   bool payment_requested,
-  const struct ANASTASIS_PaymentSecretP *paid_order_id,
   struct GNUNET_TIME_Relative payment_timeout,
   ANASTASIS_TruthStoreCallback cb,
   void *cb_cls)
@@ -264,7 +263,6 @@ ANASTASIS_truth_store (
   tso = GNUNET_new (struct ANASTASIS_TruthStoreOperation);
   {
     char *uuid_str;
-    char *poi_str;
     char *path;
     char timeout_ms[32];
 
@@ -274,11 +272,6 @@ ANASTASIS_truth_store (
                      tms);
     uuid_str = GNUNET_STRINGS_data_to_string_alloc (uuid,
                                                     sizeof (*uuid));
-    if (NULL != paid_order_id)
-      poi_str = GNUNET_STRINGS_data_to_string_alloc (paid_order_id,
-                                                     sizeof (*paid_order_id));
-    else
-      poi_str = NULL;
     GNUNET_asprintf (&path,
                      "truth/%s",
                      uuid_str);
@@ -286,17 +279,12 @@ ANASTASIS_truth_store (
                                path,
                                "pay",
                                (payment_requested) ? "y" : NULL,
-                               "paying",
-                               (NULL != paid_order_id)
-                               ? poi_str
-                               : NULL,
                                "timeout_ms",
                                (0 != payment_timeout.rel_value_us)
                                ? timeout_ms
                                : NULL,
                                NULL);
     GNUNET_free (path);
-    GNUNET_free (poi_str);
     GNUNET_free (uuid_str);
   }
   {
diff --git a/src/testing/test_anastasis.c b/src/testing/test_anastasis.c
index 999773c..8b6ed32 100644
--- a/src/testing/test_anastasis.c
+++ b/src/testing/test_anastasis.c
@@ -189,7 +189,6 @@ run (void *cls,
                                                  "answer the question",
                                                  "text/plain",
                                                  "SomeTruth1",
-                                                 NULL,
                                                  MHD_HTTP_NO_CONTENT,
                                                  ANASTASIS_TESTING_TSO_NONE,
                                                  "salt-request-1"),
@@ -199,7 +198,6 @@ run (void *cls,
                                                  "answer the question",
                                                  "text/plain",
                                                  "SomeTruth2",
-                                                 NULL,
                                                  MHD_HTTP_NO_CONTENT,
                                                  ANASTASIS_TESTING_TSO_NONE,
                                                  "salt-request-1"),
@@ -211,7 +209,6 @@ run (void *cls,
                                         "text/plain",
                                         file_secret,
                                         strlen (file_secret),
-                                        NULL,
                                         MHD_HTTP_NO_CONTENT,
                                         ANASTASIS_TESTING_TSO_NONE,
                                         "salt-request-1"),
diff --git a/src/testing/testing_api_cmd_truth_store.c 
b/src/testing/testing_api_cmd_truth_store.c
index efacc3f..7df2c70 100644
--- a/src/testing/testing_api_cmd_truth_store.c
+++ b/src/testing/testing_api_cmd_truth_store.c
@@ -105,11 +105,6 @@ struct TruthStoreState
    */
   struct ANASTASIS_PaymentSecretP payment_secret_response;
 
-  /**
-   * Payment order ID we are to provide in the request, or all zeros.
-   */
-  struct ANASTASIS_PaymentSecretP payment_secret_request;
-
   /**
    * Options for how we are supposed to do the upload.
    */
@@ -204,22 +199,6 @@ truth_store_run (void *cls,
       return;
     }
 
-    if (0 != (ANASTASIS_TESTING_TSO_REFERENCE_ORDER_ID & tss->tsopt))
-    {
-      const struct ANASTASIS_PaymentSecretP *ps_req;
-
-      if (GNUNET_OK !=
-          ANASTASIS_TESTING_get_trait_payment_secret (ref,
-                                                      0,
-                                                      &ps_req))
-      {
-        GNUNET_break (0);
-        TALER_TESTING_interpreter_fail (tss->is);
-        return;
-      }
-      tss->payment_secret_request = *ps_req;
-    }
-
     if (0 != (ANASTASIS_TESTING_TSO_REFERENCE_UUID & tss->tsopt))
     {
       const struct ANASTASIS_CRYPTO_TruthUUIDP *uuid;
@@ -301,9 +280,6 @@ truth_store_run (void *cls,
       size_encrypted_truth,
       encrypted_truth,
       (0 != (ANASTASIS_TESTING_TSO_REQUEST_PAYMENT & tss->tsopt)),
-      (0 != (ANASTASIS_TESTING_TSO_REFERENCE_ORDER_ID & tss->tsopt))
-      ? &tss->payment_secret_request
-      : NULL,
       GNUNET_TIME_UNIT_ZERO,
       &truth_store_cb,
       tss);
diff --git a/src/testing/testing_cmd_truth_upload.c 
b/src/testing/testing_cmd_truth_upload.c
index 740d5e3..d75c39c 100644
--- a/src/testing/testing_cmd_truth_upload.c
+++ b/src/testing/testing_cmd_truth_upload.c
@@ -73,12 +73,6 @@ struct TruthUploadState
    */
   void *truth_data;
 
-  /**
-   * Command to a previous truth upload from which to take the
-   * @a payment_secret_request.
-   */
-  const char *paid_order_ref;
-
   /**
    * Requested order ID for this upload (if unpaid).
    */
@@ -167,7 +161,6 @@ truth_upload_run (void *cls,
   const struct TALER_TESTING_Command *ref;
   const struct ANASTASIS_CRYPTO_ProviderSaltP *salt;
   struct ANASTASIS_CRYPTO_UserIdentifierP user_id;
-  const struct ANASTASIS_PaymentSecretP *ps;
 
   tus->is = is;
   if (NULL != tus->salt_reference)
@@ -192,33 +185,6 @@ truth_upload_run (void *cls,
     }
   }
 
-  if (NULL != tus->paid_order_ref)
-  {
-    const struct TALER_TESTING_Command *ref;
-
-    ref = TALER_TESTING_interpreter_lookup_command (is,
-                                                    tus->paid_order_ref);
-    if (NULL == ref)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (tus->is);
-      return;
-    }
-    if (GNUNET_OK !=
-        ANASTASIS_TESTING_get_trait_payment_secret (ref,
-                                                    0,
-                                                    &ps))
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (tus->is);
-      return;
-    }
-  }
-  else
-  {
-    ps = NULL;
-  }
-
   ANASTASIS_CRYPTO_user_identifier_derive (tus->id_data,
                                            salt,
                                            &user_id);
@@ -233,7 +199,6 @@ truth_upload_run (void *cls,
                                      tus->truth_data,
                                      tus->truth_data_size,
                                      false, /* force payment */
-                                     ps,
                                      GNUNET_TIME_UNIT_ZERO,
                                      &truth_upload_cb,
                                      tus);
@@ -335,7 +300,6 @@ ANASTASIS_TESTING_cmd_truth_upload (
   const char *mime_type,
   const void *truth_data,
   size_t truth_data_size,
-  const char *paid_order_ref,
   unsigned int http_status,
   enum ANASTASIS_TESTING_TruthStoreOption tso,
   const char *salt_ref)
@@ -352,7 +316,6 @@ ANASTASIS_TESTING_cmd_truth_upload (
   tus->method = method;
   tus->instructions = instructions;
   tus->mime_type = mime_type;
-  tus->paid_order_ref = paid_order_ref;
   tus->truth_data_size = truth_data_size;
   tus->truth_data = GNUNET_memdup (truth_data,
                                    truth_data_size);
@@ -378,7 +341,6 @@ ANASTASIS_TESTING_cmd_truth_upload_question (
   const char *instructions,
   const char *mime_type,
   const void *answer,
-  const char *paid_order_ref,
   unsigned int http_status,
   enum ANASTASIS_TESTING_TruthStoreOption tso,
   const char *salt_ref)
@@ -391,7 +353,6 @@ ANASTASIS_TESTING_cmd_truth_upload_question (
                                              mime_type,
                                              answer,
                                              strlen (answer),
-                                             paid_order_ref,
                                              http_status,
                                              tso,
                                              salt_ref);

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