gnunet-svn
[Top][All Lists]
Advanced

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

[taler-donau] branch master updated: parse JSON


From: gnunet
Subject: [taler-donau] branch master updated: parse JSON
Date: Wed, 15 May 2024 10:39:04 +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 7eb42ec  parse JSON
7eb42ec is described below

commit 7eb42ecdd9afd9d577e0e0b394ca99782cfbd132
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
AuthorDate: Wed May 15 10:39:58 2024 +0200

    parse JSON
---
 src/donau/donau-httpd_batch-submit.c         | 8 ++++----
 src/lib/donau_api_batch_submit_receipts.c    | 4 ++--
 src/lib/donau_api_csr_post.c                 | 6 +++---
 src/testing/test_donau_api.c                 | 8 ++++----
 src/testing/testing_api_cmd_issue_receipts.c | 6 +++---
 src/util/donau_crypto.c                      | 3 ++-
 6 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/donau/donau-httpd_batch-submit.c 
b/src/donau/donau-httpd_batch-submit.c
index 5d9b7be..0ad55a1 100644
--- a/src/donau/donau-httpd_batch-submit.c
+++ b/src/donau/donau-httpd_batch-submit.c
@@ -37,7 +37,7 @@
  */
 struct InsertReceiptContext
 {
-  struct DONAU_HashDonorTaxId *h_donor_tax_id;
+  struct DONAU_HashDonorTaxId h_donor_tax_id;
   struct DONAU_DonationReceipt *donation_receipts;
   uint64_t donation_year;
 };
@@ -83,7 +83,7 @@ DH_handler_submit_receipts_post (struct DH_RequestContext *rc,
                                  const json_t *root,
                                  const char *const args[])
 {
-  struct InsertReceiptContext irc;
+  struct InsertReceiptContext irc = {0};
   const json_t *donation_receipts;
 
   struct GNUNET_JSON_Specification spec[] = {
@@ -160,7 +160,7 @@ DH_handler_submit_receipts_post (struct DH_RequestContext 
*rc,
     }
 
     DONAU_unique_donor_id_hash (
-      irc.h_donor_tax_id,
+      &irc.h_donor_tax_id,
       &irc.donation_receipts[i].nonce,
       &udi_hash);
 
@@ -185,7 +185,7 @@ DH_handler_submit_receipts_post (struct DH_RequestContext 
*rc,
 
   qs = DH_plugin->insert_submitted_receipts (
     DH_plugin->cls,
-    irc.h_donor_tax_id,
+    &irc.h_donor_tax_id,
     num_dr,
     irc.donation_receipts,
     irc.donation_year);
diff --git a/src/lib/donau_api_batch_submit_receipts.c 
b/src/lib/donau_api_batch_submit_receipts.c
index d0ddfe3..1647230 100644
--- a/src/lib/donau_api_batch_submit_receipts.c
+++ b/src/lib/donau_api_batch_submit_receipts.c
@@ -93,7 +93,7 @@ submit_request_body_to_json (const size_t num_drs,
                                   &drs[i].h_donation_unit_pub),
       GNUNET_JSON_pack_data_auto ("nonce",
                                   &drs[i].nonce),
-      DONAU_JSON_pack_donation_unit_sig ("donau_sig",
+      DONAU_JSON_pack_donation_unit_sig ("donation_unit_sig",
                                          &drs[i].donation_unit_sig));
     GNUNET_assert (0 ==
                    json_array_append_new (donation_receipts,
@@ -102,7 +102,7 @@ submit_request_body_to_json (const size_t num_drs,
   return GNUNET_JSON_PACK (
     GNUNET_JSON_pack_array_steal ("donation_receipts",
                                   donation_receipts),
-    GNUNET_JSON_pack_data_auto ("h_tax_number",
+    GNUNET_JSON_pack_data_auto ("h_donor_tax_id",
                                 h_tax_id),
     GNUNET_JSON_pack_uint64 ("donation_year",
                              year));
diff --git a/src/lib/donau_api_csr_post.c b/src/lib/donau_api_csr_post.c
index f0504c3..4dddf13 100644
--- a/src/lib/donau_api_csr_post.c
+++ b/src/lib/donau_api_csr_post.c
@@ -122,9 +122,9 @@ handle_csr_issue_post_finished (void *cls,
     csrresp.hr.hint = TALER_JSON_get_error_hint (j);
     break;
   case MHD_HTTP_BAD_REQUEST:
-       csrresp.hr.ec = TALER_JSON_get_error_code (j);
-       csrresp.hr.hint = TALER_JSON_get_error_hint (j);
-       break;
+    csrresp.hr.ec = TALER_JSON_get_error_code (j);
+    csrresp.hr.hint = TALER_JSON_get_error_hint (j);
+    break;
   default:
     /* unexpected response code */
     GNUNET_break_op (0);
diff --git a/src/testing/test_donau_api.c b/src/testing/test_donau_api.c
index e8caebc..983122b 100644
--- a/src/testing/test_donau_api.c
+++ b/src/testing/test_donau_api.c
@@ -95,10 +95,10 @@ run (void *cls,
                                         "7560001010000", // tax id
                                         "1234", // salt for tax id hash
                                         MHD_HTTP_CREATED),
-//         TALER_TESTING_cmd_submit_receipts ("submit-receipts",
-//                                       "issue-receipts", // cmd trait 
reference
-//                                       2024,
-//                                       MHD_HTTP_OK),
+           TALER_TESTING_cmd_submit_receipts ("submit-receipts",
+                                       "issue-receipts", // cmd trait reference
+                                       2024,
+                                       MHD_HTTP_OK),
       TALER_TESTING_cmd_charity_delete ("delete-charity",
                                         "post-charity", // cmd trait reference
                                         &bearer,
diff --git a/src/testing/testing_api_cmd_issue_receipts.c 
b/src/testing/testing_api_cmd_issue_receipts.c
index f3a7fda..2f4a2f8 100644
--- a/src/testing/testing_api_cmd_issue_receipts.c
+++ b/src/testing/testing_api_cmd_issue_receipts.c
@@ -254,9 +254,9 @@ cs_stage_two_callback (
 
   GNUNET_assert (GNUNET_CRYPTO_BSA_CS == cs_pk->bsign_pub_key->cipher);
 
-  DONAU_donation_unit_ewv_copy ( alg_values,
-                         &csrresp->details.ok.
-                        alg_values);
+  DONAU_donation_unit_ewv_copy (alg_values,
+                                &csrresp->details.ok.
+                                alg_values);
   GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_STRONG,
                               &ps,
                               sizeof (ps));
diff --git a/src/util/donau_crypto.c b/src/util/donau_crypto.c
index 99c0b70..40fc1b7 100644
--- a/src/util/donau_crypto.c
+++ b/src/util/donau_crypto.c
@@ -291,9 +291,10 @@ DONAU_donation_unit_ewv_rsa_singleton ()
   return &alg_values;
 }
 
+
 void
 DONAU_donation_unit_ewv_copy (struct DONAU_BatchIssueValues *bi_dst,
-                      const struct DONAU_BatchIssueValues *bi_src)
+                              const struct DONAU_BatchIssueValues *bi_src)
 {
   if (bi_src == DONAU_donation_unit_ewv_rsa_singleton ())
   {

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