gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 02/02: time rounding


From: gnunet
Subject: [taler-anastasis] 02/02: time rounding
Date: Thu, 07 Nov 2019 10:45:56 +0100

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

grothoff pushed a commit to branch master
in repository anastasis.

commit b8c1a378d2c453a431f33cefc0bafbb678d00782
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Nov 7 10:45:51 2019 +0100

    time rounding
---
 src/backup-db/plugin_anastasis_postgres.c | 9 ++++++---
 src/backup-db/test_anastasis_db.c         | 2 +-
 2 files changed, 7 insertions(+), 4 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 7a913b7..ac61eb1 100644
--- a/src/backup-db/test_anastasis_db.c
+++ b/src/backup-db/test_anastasis_db.c
@@ -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,

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



reply via email to

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