gnunet-svn
[Top][All Lists]
Advanced

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

[taler-donau] branch master updated: [testing] working cs issue receipts


From: gnunet
Subject: [taler-donau] branch master updated: [testing] working cs issue receipts test
Date: Thu, 16 May 2024 01:51:18 +0200

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

lukas-matyja pushed a commit to branch master
in repository donau.

The following commit(s) were added to refs/heads/master by this push:
     new a456a67  [testing] working cs issue receipts test
a456a67 is described below

commit a456a67060231b368ee58329bdbb19cb3b6564be
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
AuthorDate: Thu May 16 01:52:21 2024 +0200

    [testing] working cs issue receipts test
---
 src/testing/testing_api_cmd_issue_receipts.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/testing/testing_api_cmd_issue_receipts.c 
b/src/testing/testing_api_cmd_issue_receipts.c
index 2f4a2f8..be8b962 100644
--- a/src/testing/testing_api_cmd_issue_receipts.c
+++ b/src/testing/testing_api_cmd_issue_receipts.c
@@ -137,9 +137,9 @@ struct CSR_Data
   struct StatusState *ss;
 
   /**
-   * array position in batch issue receipt request (first position is zero)
+   * array position in batch issue receipt request (first position is one)
    */
-  size_t position;
+  unsigned int position;
 };
 
 
@@ -225,7 +225,11 @@ cs_stage_two_callback (
   const struct DONAU_CsRBatchIssueResponse *csrresp)
 {
   struct CSR_Data *csr_data = cls;
-  csr_data->csr_handle = NULL;
+  /* ignore multiple callbacks from the same csr request by checking
+     if the corresponding blinded message is already initialized */
+  if (NULL != 
&csr_data->ss->bkps[csr_data->position].blinded_udi.blinded_message->cipher) {
+         return;
+  }
   if (csrresp->hr.http_status != MHD_HTTP_CREATED)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -242,7 +246,7 @@ cs_stage_two_callback (
 
   struct DONAU_DonationUnitPublicKey *cs_pk =
     &csr_data->ss->keys->donation_unit_keys[csr_data->position].key;
-  struct DONAU_BatchIssueValues *alg_values = {0};
+  struct DONAU_BatchIssueValues *alg_values = GNUNET_new (struct 
DONAU_BatchIssueValues);
   struct DONAU_BudiMasterSecretP ps;
   struct DONAU_BlindedUniqueDonorIdentifier *blinded_udi =
     &csr_data->ss->bkps[csr_data->position].blinded_udi;
@@ -254,6 +258,8 @@ cs_stage_two_callback (
 
   GNUNET_assert (GNUNET_CRYPTO_BSA_CS == cs_pk->bsign_pub_key->cipher);
 
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "position value: %d\n", csr_data->position);
   DONAU_donation_unit_ewv_copy (alg_values,
                                 &csrresp->details.ok.
                                 alg_values);
@@ -277,7 +283,7 @@ cs_stage_two_callback (
   csr_data->ss->cs_pending--;
   if (0 == csr_data->ss->cs_pending)
     phase_two (csr_data->ss);
-  GNUNET_free (csr_data);
+  //GNUNET_free (csr_data);
 }
 
 
@@ -347,7 +353,7 @@ status_run (void *cls,
   ss->receipts =
     GNUNET_new_array (ss->num_bkp, struct DONAU_DonationReceipt);
   ss->alg_values =
-    GNUNET_new_array (ss->num_bkp, const struct DONAU_BatchIssueValues*);
+    GNUNET_new_array (ss->num_bkp, const struct DONAU_BatchIssueValues *);
   ss->h_udis =
     GNUNET_new_array (ss->num_bkp, struct DONAU_UniqueDonorIdentifierHashP);
   for (size_t cnt = 0; cnt < ss->num_bkp; cnt++)

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