gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated (aa25770 -> b8c1a37)


From: gnunet
Subject: [taler-anastasis] branch master updated (aa25770 -> b8c1a37)
Date: Thu, 07 Nov 2019 10:45:54 +0100

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

grothoff pushed a change to branch master
in repository anastasis.

    from aa25770  fix site
     new 7637023  fix
     new b8c1a37  time rounding

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/backup-db/plugin_anastasis_postgres.c |  9 ++++--
 src/backup-db/test_anastasis_db.c         | 10 +++---
 src/include/anastasis_service.h           | 54 +++++++++++++++++++------------
 3 files changed, 45 insertions(+), 28 deletions(-)

diff --git a/src/backup-db/plugin_anastasis_postgres.c 
b/src/backup-db/plugin_anastasis_postgres.c
index f4bce5c..4867d85 100644
--- a/src/backup-db/plugin_anastasis_postgres.c
+++ b/src/backup-db/plugin_anastasis_postgres.c
@@ -524,7 +524,7 @@ postgres_record_payment (void *cls,
     /* user did not yet exist, create */
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
-      GNUNET_PQ_query_param_absolute_time (&paid_until),
+      TALER_PQ_query_param_absolute_time (&paid_until),
       GNUNET_PQ_query_param_end
     };
 
@@ -536,7 +536,7 @@ postgres_record_payment (void *cls,
   {
     /* user exists, update */
     struct GNUNET_PQ_QueryParam params[] = {
-      GNUNET_PQ_query_param_absolute_time (&paid_until),
+      TALER_PQ_query_param_absolute_time (&paid_until),
       GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
       GNUNET_PQ_query_param_end
     };
@@ -629,7 +629,10 @@ postgres_store_truth (void *cls,
   enum ANASTASIS_DB_QueryStatus qs;
   struct GNUNET_TIME_Absolute expiration = GNUNET_TIME_absolute_get ();
 
-  expiration = GNUNET_TIME_absolute_add (expiration, truth_expiration);
+  GNUNET_TIME_round_abs (&expiration);
+  expiration = GNUNET_TIME_absolute_add (expiration,
+                                         truth_expiration);
+
   check_connection (pg);
   if (GNUNET_OK != begin_transaction (pg,
                                       "store_truth"))
diff --git a/src/backup-db/test_anastasis_db.c 
b/src/backup-db/test_anastasis_db.c
index d133127..ac61eb1 100644
--- a/src/backup-db/test_anastasis_db.c
+++ b/src/backup-db/test_anastasis_db.c
@@ -132,12 +132,12 @@ static char **res_mime_type;
 /**
  * Version of a Recoverydocument
  */
-static uint32_t *version;
+static uint32_t version;
 
 /**
  * Version of the latest Recoverydocument
  */
-static uint32_t *res_version;
+static uint32_t res_version;
 
 
 /**
@@ -192,7 +192,7 @@ run (void *cls)
   TALER_string_to_amount ("EUR:30",&amount);
   uuid = (struct ANASTASIS_uuid) {"550e8400-e29b-11d4-a716-446655440000"};
   struct GNUNET_TIME_Relative rel_time;
-  rel_time.rel_value_us = (uint64_t) 50 * 1000LL;
+  rel_time = GNUNET_TIME_UNIT_SECONDS;
 
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->record_payment (plugin->cls,
@@ -208,7 +208,7 @@ run (void *cls)
                                            &recovery_data,
                                            sizeof (&recovery_data),
                                            &paymentSecretP,
-                                           version));
+                                           &version));
 
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->store_truth (plugin->cls,
@@ -238,7 +238,7 @@ run (void *cls)
                                                 &accountPubP,
                                                 recoverydatasize,
                                                 res_recovery_data,
-                                                res_version));
+                                                &res_version));
 
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->get_recovery_document (plugin->cls,
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index ad6e6c0..4370d9d 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -14,33 +14,47 @@
   Anastasis; see the file COPYING.LIB.  If not, see 
<http://www.gnu.org/licenses/>
 */
 /**
- * @file include/taler_merchant_service.h
- * @brief C interface of libtalermerchant, a C library to use merchant's HTTP 
API
+ * @file include/anastasis_service.h
+ * @brief C interface of libanastasisrest, a C library to use merchant's HTTP 
API
  * @author Christian Grothoff
  * @author Marcello Stanisci
  */
-#ifndef _ANASTASIS_MERCHANT_SERVICE_H
-#define _ANASTASIS_MERCHANT_SERVICE_H
+#ifndef _ANASTASIS_SERVICE_H
+#define _ANASTASIS_SERVICE_H
 
 #include <gnunet/gnunet_curl_lib.h>
 #include <jansson.h>
 
-struct Anastasis_MERCHANT_Pay *
-Anastasis_MERCHANT_pay_abort (struct GNUNET_CURL_Context *ctx,
-                              const char *merchant_url,
-                              const char *instance,
-                              const struct GNUNET_HashCode *h_contract,
-                              const struct Anastasis_Amount *amount,
-                              const struct Anastasis_Amount *max_fee,
-                              const struct
-                              Anastasis_MerchantPublicKeyP *merchant_pub,
-                              const struct
-                              Anastasis_MerchantSignatureP *merchant_sig,
-                              struct GNUNET_TIME_Absolute timestamp,
-                              struct GNUNET_TIME_Absolute refund_deadline,
-                              struct GNUNET_TIME_Absolute pay_deadline,
-                              const struct GNUNET_HashCode *h_wire,
-                              const char *order_id);
+struct ANASTASIS_SaltOperation;
+
+/**
+ * Salt value of an Anastasis service provider.
+ */
+struct ANASTASIS_Salt
+{
+  /**
+   * Salt is specified as 32 byte (256 bit).
+   */
+  uint32_t value[8];
+};
+
+
+typedef void
+(ANASTASIS_SaltCallback)(void *cls,
+                         const struct ANASTASIS_Salt *salt);
+
+
+struct ANASTASIS_SaltOperation *
+ANASTASIS_salt (struct GNUNET_CURL_Context *ctx,
+                const char *base_url,
+                ANASTASIS_SaltCallback sb,
+                void *sb_cls);
+
+
+void
+ANASTASIS_salt_cancel (struct ANASTASIS_SaltOperation *so);
+
+
 
 
 #endif  /* _ANASTASIS_MERCHANT_SERVICE_H */

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



reply via email to

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