gnunet-svn
[Top][All Lists]
Advanced

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

[taler-donau] branch master updated: [donau] add ec and make charity loo


From: gnunet
Subject: [taler-donau] branch master updated: [donau] add ec and make charity lookup for issue receipts
Date: Tue, 19 Mar 2024 13:29:24 +0100

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 99cafcd  [donau] add ec and make charity lookup for issue receipts
     new 21768ed  Merge remote-tracking branch 'refs/remotes/origin/master'
99cafcd is described below

commit 99cafcd070243660a5f38de1d1ba9f6d30173fac
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
AuthorDate: Tue Mar 19 13:28:03 2024 +0100

    [donau] add ec and make charity lookup for issue receipts
---
 src/donau/donau-httpd_post-batch-issue.c | 39 ++++++++++++++++++++++++++++----
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/src/donau/donau-httpd_post-batch-issue.c 
b/src/donau/donau-httpd_post-batch-issue.c
index 6ff9ab4..1638511 100644
--- a/src/donau/donau-httpd_post-batch-issue.c
+++ b/src/donau/donau-httpd_post-batch-issue.c
@@ -203,11 +203,39 @@ DH_handler_issue_receipts_post (struct DH_RequestContext 
*rc,
                                               "budikeypairs");
   }
 
+  // Get charity pub
+
+  struct DONAUDB_CharityMetaData meta;
+  enum GNUNET_DB_QueryStatus qs;
+  //MHD_RESULT result;
+
+  qs = DH_plugin->lookup_charity (DH_plugin->cls,
+                                                                       
(uint64_t) charity_id,
+                                                                       &meta);
+  switch (qs)
+  {
+  case GNUNET_DB_STATUS_HARD_ERROR:
+  case GNUNET_DB_STATUS_SOFT_ERROR:
+         GNUNET_break (0);
+         return TALER_MHD_reply_with_error (rc->connection,
+                                                                               
 MHD_HTTP_INTERNAL_SERVER_ERROR,
+                                                                               
 TALER_EC_GENERIC_DB_FETCH_FAILED,
+                                                                               
 NULL);
+  case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+         return TALER_MHD_reply_with_error (
+               rc->connection,
+               MHD_HTTP_NOT_FOUND,
+               TALER_EC_DONAU_CHARITY_NOT_FOUND,
+               NULL);
+   break;
+   case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
+        break;
+   }
+
   /* verify charity signature */
-  //TODO: Get charity pub
   if (GNUNET_OK !=
                  DONAU_charity_budi_key_pair_verify(num_bkp, &irc.bkp,
-                                                                               
          &irc.charity_pub,
+                                                                               
          &meta.charity_pub,
                                                                                
          &irc.charity_sig))
   {
        GNUNET_break_op (0);
@@ -261,8 +289,11 @@ DH_handler_issue_receipts_post (struct DH_RequestContext 
*rc,
 //                             meta.current_year));
 
 
-  MHD_RESULT result;
-  return result;
+  return TALER_MHD_reply_with_error (
+       rc->connection,
+       MHD_HTTP_NOT_FOUND,
+       TALER_EC_DONAU_CHARITY_NOT_FOUND,
+       NULL);
 }
 
 

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