gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-anastasis] branch master updated: Fixed storing reco


From: gnunet
Subject: [GNUnet-SVN] [taler-anastasis] branch master updated: Fixed storing recovery document
Date: Thu, 17 Oct 2019 08:59:41 +0200

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

dennis-neufeld pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 3b1e913  Fixed storing recovery document
3b1e913 is described below

commit 3b1e913443d38c00ca15b574a6a7f2788645081e
Author: Dennis Neufeld <address@hidden>
AuthorDate: Thu Oct 17 08:59:37 2019 +0200

    Fixed storing recovery document
---
 src/backup-db/plugin_anastasis_postgres.c | 28 +++++++++++-----------------
 src/include/anastasis_database_plugin.h   |  1 +
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/src/backup-db/plugin_anastasis_postgres.c 
b/src/backup-db/plugin_anastasis_postgres.c
index ae1ebaa..b9e4646 100644
--- a/src/backup-db/plugin_anastasis_postgres.c
+++ b/src/backup-db/plugin_anastasis_postgres.c
@@ -210,7 +210,6 @@ postgres_commit (void *cls)
 }
 
 /**
-  * FIXME
   * Upload encrypted recovery document.
   *
   * @param cls closure
@@ -234,25 +233,19 @@ postgres_store_recovery_document (void *cls,
   struct PostgresClosure *pg = cls;
   struct GNUNET_PQ_QueryParam params[] = {
     GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
-    GNUNET_PQ_query_param_auto_from_type (&h_contract_terms),
+    GNUNET_PQ_query_param_fixed_size (data, data_size),
+    GNUNET_PQ_query_param_auto_from_type (payment_secret),
+    GNUNET_PQ_query_param_uint32 (version),
     GNUNET_PQ_query_param_end
   };
-
-  if (GNUNET_OK !=
-      TALER_JSON_hash (contract_terms,
-                       &h_contract_terms))
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
+  
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "inserting contract terms: order_id: %s, anastasis_pub: %s, 
h_contract_terms: %s.\n",
-              order_id,
-              TALER_B2S (anastasis_pub),
-              GNUNET_h2s (&h_contract_terms));
+              "inserting recovery document: user_id: %s, version: %i.\n",
+              GNUNET_p2s (anastasis_pub),
+              version);
   check_connection (pg);
   return GNUNET_PQ_eval_prepared_non_select (pg->conn,
-                                             "insert_contract_terms",
+                                             "store_recovery_document",
                                              params);
 }
 
@@ -271,7 +264,7 @@ postgres_store_recovery_document (void *cls,
  */
 static enum GNUNET_DB_QueryStatus
 postgres_record_payment (void *cls,
-                         const *payment_id,
+                         const uint32_t *payment_id,
                          const struct TALER_Amount *amount,
                          const struct ANASTASIS_AccountPubP *anastasis_pub,
                          unsigned int *num_uploads,
@@ -280,7 +273,8 @@ postgres_record_payment (void *cls,
 {
   struct PostgresClosure *pg = cls;
   struct GNUNET_PQ_QueryParam params[] = {
-    GNUNET_PQ_query_param_string (payment_id),
+    GNUNET_PQ_query_param_auto_from_type (payment_id),
+    GNUNET_PQ_query_param_auto_from_type (amount),
     GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
     GNUNET_PQ_query_param_absolute_time (&lifetime_inc),
     GNUNET_PQ_query_param_end
diff --git a/src/include/anastasis_database_plugin.h 
b/src/include/anastasis_database_plugin.h
index 1ff906d..6ce9c6d 100644
--- a/src/include/anastasis_database_plugin.h
+++ b/src/include/anastasis_database_plugin.h
@@ -121,6 +121,7 @@ struct AnastasisDatabasePlugin
    */
   enum GNUNET_DB_QueryStatus
   (*record_payment)(void *cls,
+                    const uint32_t payment_id,
                     const struct TALER_Amount *amount,
                     const struct ANASTASIS_AccountPubP *anastasis_pub,
                     unsigned int num_uploads,

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]