gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: test-sync passes again


From: gnunet
Subject: [taler-exchange] branch master updated: test-sync passes again
Date: Mon, 28 Feb 2022 23:18:43 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new e24a6369 test-sync passes again
e24a6369 is described below

commit e24a6369aae5c2ab6ccec4ecdd269a280078f790
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Feb 28 23:18:40 2022 +0100

    test-sync passes again
---
 src/auditor/Makefile.am                     |  5 +++-
 src/auditor/taler-auditor-sync.c            | 11 +++-----
 src/auditor/test-sync.sh                    |  2 +-
 src/exchangedb/irbt_callbacks.c             |  5 +++-
 src/exchangedb/lrbt_callbacks.c             |  7 +++--
 src/exchangedb/plugin_exchangedb_postgres.c | 41 +++++++++++++++++++++++++++++
 6 files changed, 59 insertions(+), 12 deletions(-)

diff --git a/src/auditor/Makefile.am b/src/auditor/Makefile.am
index cdf644d1..634026ab 100644
--- a/src/auditor/Makefile.am
+++ b/src/auditor/Makefile.am
@@ -193,8 +193,11 @@ check_SCRIPTS = \
   test-sync.sh
 
 .NOTPARALLEL:
-# Disabled for now: need working wallet first!
+# revocation test disabled for now: need working wallet first!
 # TESTS = $(check_SCRIPTS)
+TESTS = \
+  test-auditor.sh \
+  test-sync.sh
 
 EXTRA_DIST = \
   taler-auditor.in \
diff --git a/src/auditor/taler-auditor-sync.c b/src/auditor/taler-auditor-sync.c
index 17c4da46..4b9595c6 100644
--- a/src/auditor/taler-auditor-sync.c
+++ b/src/auditor/taler-auditor-sync.c
@@ -91,6 +91,7 @@ struct Table
 static struct Table tables[] = {
   { .rt = TALER_EXCHANGEDB_RT_DENOMINATIONS},
   { .rt = TALER_EXCHANGEDB_RT_DENOMINATION_REVOCATIONS},
+  { .rt = TALER_EXCHANGEDB_RT_WIRE_TARGETS},
   { .rt = TALER_EXCHANGEDB_RT_RESERVES},
   { .rt = TALER_EXCHANGEDB_RT_RESERVES_IN},
   { .rt = TALER_EXCHANGEDB_RT_RESERVES_CLOSE},
@@ -202,20 +203,16 @@ transact (void)
     src->lookup_serial_by_table (src->cls,
                                  tables[i].rt,
                                  &tables[i].end_serial);
-  if (0 >
-      src->commit (src->cls))
-    return GNUNET_SYSERR;
+  src->rollback (src->cls);
   if (GNUNET_OK !=
-      dst->start (src->cls,
+      dst->start (dst->cls,
                   "lookup dst serials"))
     return GNUNET_SYSERR;
   for (unsigned int i = 0; ! tables[i].end; i++)
     dst->lookup_serial_by_table (dst->cls,
                                  tables[i].rt,
                                  &tables[i].start_serial);
-  if (0 >
-      dst->commit (dst->cls))
-    return GNUNET_SYSERR;
+  dst->rollback (dst->cls);
   for (unsigned int i = 0; ! tables[i].end; i++)
   {
     struct Table *table = &tables[i];
diff --git a/src/auditor/test-sync.sh b/src/auditor/test-sync.sh
index a69201a8..af6f4553 100755
--- a/src/auditor/test-sync.sh
+++ b/src/auditor/test-sync.sh
@@ -16,7 +16,7 @@ echo -n "."
 psql talercheck-in < auditor-basedb.sql >/dev/null 2> /dev/null
 
 echo -n "."
-taler-auditor-sync -s test-sync-in.conf -d test-sync-out.conf -t
+~/bin/taler-auditor-sync -s test-sync-in.conf -d test-sync-out.conf -t
 
 # cs_nonce_locks excluded: no point
 for table in denominations denomination_revocations wire_targets reserves 
reserves_in reserves_close reserves_out auditors auditor_denom_sigs 
exchange_sign_keys signkey_revocations extensions extension_details known_coins 
refresh_commitments refresh_revealed_coins refresh_transfer_keys deposits 
refunds wire_out aggregation_tracking wire_fee recoup recoup_refresh
diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c
index a994c611..97ce2c09 100644
--- a/src/exchangedb/irbt_callbacks.c
+++ b/src/exchangedb/irbt_callbacks.c
@@ -115,12 +115,15 @@ irbt_cb_table_wire_targets (struct PostgresClosure *pg,
 {
   struct TALER_PaytoHashP payto_hash;
   struct GNUNET_PQ_QueryParam params[] = {
+    GNUNET_PQ_query_param_uint64 (&td->serial),
     GNUNET_PQ_query_param_auto_from_type (&payto_hash),
     GNUNET_PQ_query_param_string (
       td->details.wire_targets.payto_uri),
     GNUNET_PQ_query_param_auto_from_type (
       &td->details.wire_targets.kyc_ok),
-    GNUNET_PQ_query_param_string (
+    NULL == td->details.wire_targets.external_id
+    ? GNUNET_PQ_query_param_null ()
+    : GNUNET_PQ_query_param_string (
       td->details.wire_targets.external_id),
     GNUNET_PQ_query_param_end
   };
diff --git a/src/exchangedb/lrbt_callbacks.c b/src/exchangedb/lrbt_callbacks.c
index f8c93a38..01eddc5a 100644
--- a/src/exchangedb/lrbt_callbacks.c
+++ b/src/exchangedb/lrbt_callbacks.c
@@ -175,6 +175,7 @@ lrbt_cb_table_wire_targets (void *cls,
 
   for (unsigned int i = 0; i<num_results; i++)
   {
+    bool no_xid;
     struct GNUNET_PQ_ResultSpec rs[] = {
       GNUNET_PQ_result_spec_uint64 ("serial",
                                     &td.serial),
@@ -182,8 +183,10 @@ lrbt_cb_table_wire_targets (void *cls,
                                     &td.details.wire_targets.payto_uri),
       GNUNET_PQ_result_spec_auto_from_type ("kyc_ok",
                                             &td.details.wire_targets.kyc_ok),
-      GNUNET_PQ_result_spec_string ("external_id",
-                                    &td.details.wire_targets.external_id),
+      GNUNET_PQ_result_spec_allow_null (
+        GNUNET_PQ_result_spec_string ("external_id",
+                                      &td.details.wire_targets.external_id),
+        &no_xid),
       GNUNET_PQ_result_spec_end
     };
 
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index 12f18d0b..c8c0c296 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -1923,6 +1923,14 @@ prepare_statements (struct PostgresClosure *pg)
       " ORDER BY denom_revocations_serial_id DESC"
       " LIMIT 1;",
       0),
+    GNUNET_PQ_make_prepare (
+      "select_serial_by_table_wire_targets",
+      "SELECT"
+      " wire_target_serial_id AS serial"
+      " FROM wire_targets"
+      " ORDER BY wire_target_serial_id DESC"
+      " LIMIT 1;",
+      0),
     GNUNET_PQ_make_prepare (
       "select_serial_by_table_reserves",
       "SELECT"
@@ -2112,6 +2120,17 @@ prepare_statements (struct PostgresClosure *pg)
       " WHERE denom_revocations_serial_id > $1"
       " ORDER BY denom_revocations_serial_id ASC;",
       1),
+    GNUNET_PQ_make_prepare (
+      "select_above_serial_by_table_wire_targets",
+      "SELECT"
+      " wire_target_serial_id AS serial"
+      ",payto_uri"
+      ",kyc_ok"
+      ",external_id"
+      " FROM wire_targets"
+      " WHERE wire_target_serial_id > $1"
+      " ORDER BY wire_target_serial_id ASC;",
+      1),
     GNUNET_PQ_make_prepare (
       "select_above_serial_by_table_reserves",
       "SELECT"
@@ -2418,6 +2437,17 @@ prepare_statements (struct PostgresClosure *pg)
       ") VALUES "
       "($1, $2, $3);",
       3),
+    GNUNET_PQ_make_prepare (
+      "insert_into_table_wire_targets",
+      "INSERT INTO wire_targets"
+      "(wire_target_serial_id"
+      ",h_payto"
+      ",payto_uri"
+      ",kyc_ok"
+      ",external_id"
+      ") VALUES "
+      "($1, $2, $3, $4, $5);",
+      5),
     GNUNET_PQ_make_prepare (
       "insert_into_table_reserves",
       "INSERT INTO reserves"
@@ -10673,6 +10703,9 @@ postgres_lookup_serial_by_table (void *cls,
   case TALER_EXCHANGEDB_RT_DENOMINATION_REVOCATIONS:
     statement = "select_serial_by_table_denomination_revocations";
     break;
+  case TALER_EXCHANGEDB_RT_WIRE_TARGETS:
+    statement = "select_serial_by_table_wire_targets";
+    break;
   case TALER_EXCHANGEDB_RT_RESERVES:
     statement = "select_serial_by_table_reserves";
     break;
@@ -10906,9 +10939,17 @@ postgres_lookup_records_by_table (void *cls,
                                              rh,
                                              &ctx);
   if (qs < 0)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "Failed to run `%s'\n",
+                statement);
     return qs;
+  }
   if (ctx.error)
+  {
+    GNUNET_break (0);
     return GNUNET_DB_STATUS_HARD_ERROR;
+  }
   return qs;
 }
 

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