gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix wire-credit


From: gnunet
Subject: [taler-exchange] branch master updated: fix wire-credit
Date: Fri, 23 Aug 2024 09:18:00 +0200

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 5fcddeed9 fix wire-credit
5fcddeed9 is described below

commit 5fcddeed9bef716475a7b46a4a6180f32812ca14
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Aug 23 09:17:57 2024 +0200

    fix wire-credit
---
 src/auditor/taler-helper-auditor-wire-credit.c          |  8 +++++---
 src/auditordb/0002-auditor_reserve_in_inconsistency.sql | 13 +++++++------
 src/auditordb/pg_insert_reserve_in_inconsistency.c      | 12 ++++++------
 src/include/taler_auditordb_plugin.h                    |  2 +-
 4 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/src/auditor/taler-helper-auditor-wire-credit.c 
b/src/auditor/taler-helper-auditor-wire-credit.c
index 2a68326b7..3f19de9a3 100644
--- a/src/auditor/taler-helper-auditor-wire-credit.c
+++ b/src/auditor/taler-helper-auditor-wire-credit.c
@@ -409,6 +409,8 @@ commit (enum GNUNET_DB_QueryStatus qs)
     TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
     TALER_ARL_edb->rollback (TALER_ARL_edb->cls);
   }
+  if (1 == test_mode)
+    GNUNET_SCHEDULER_shutdown ();
 }
 
 
@@ -525,7 +527,7 @@ complain_in_not_found (void *cls,
   struct ReserveInInfo *rii = value;
   enum GNUNET_DB_QueryStatus qs;
   struct TALER_AUDITORDB_ReserveInInconsistency riiDb = {
-    .row_id = rii->rowid,
+    .bank_row_id = rii->rowid,
     .diagnostic = "incoming wire transfer claimed by exchange not found",
     .account = (char *) wa->ai->section_name,
     .amount_exchange_expected = rii->credit_details.amount,
@@ -639,7 +641,7 @@ analyze_credit (
     struct TALER_AUDITORDB_ReserveInInconsistency riiDb = {
       .diagnostic = "wire subject does not match",
       .account = (char *) wa->ai->section_name,
-      .row_id = credit_details->serial_id, // FIXME: correct row?
+      .bank_row_id = credit_details->serial_id,
       .amount_exchange_expected = rii->credit_details.amount,
       .amount_wired = zero,
       .reserve_pub = rii->credit_details.details.reserve.reserve_pub,
@@ -674,7 +676,7 @@ analyze_credit (
     struct TALER_AUDITORDB_ReserveInInconsistency riiDb = {
       .diagnostic = "wire amount does not match",
       .account = (char *) wa->ai->section_name,
-      .row_id = credit_details->serial_id, // FIXME: correct row?
+      .bank_row_id = credit_details->serial_id,
       .amount_exchange_expected = rii->credit_details.amount,
       .amount_wired = credit_details->amount,
       .reserve_pub = rii->credit_details.details.reserve.reserve_pub,
diff --git a/src/auditordb/0002-auditor_reserve_in_inconsistency.sql 
b/src/auditordb/0002-auditor_reserve_in_inconsistency.sql
index e2e8aed05..088aab597 100644
--- a/src/auditordb/0002-auditor_reserve_in_inconsistency.sql
+++ b/src/auditordb/0002-auditor_reserve_in_inconsistency.sql
@@ -18,12 +18,13 @@ SET search_path TO auditor;
 CREATE TABLE IF NOT EXISTS auditor_reserve_in_inconsistency
 (
     row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY,
-    amount_exchange_expected taler_amount,
-    amount_wired taler_amount,
-    reserve_pub BYTEA,
-    timestamp BIGINT,
-    account BYTEA,
-    diagnostic BYTEA,
+    bank_row_id INT8 NOT NULL,
+    amount_exchange_expected taler_amount NOT NULL,
+    amount_wired taler_amount NOT NULL,
+    reserve_pub BYTEA NOT NULL,
+    timestamp BIGINT NOT NULL,
+    account BYTEA NOT NULL,
+    diagnostic BYTEA NOT NULL,
     suppressed BOOLEAN NOT NULL DEFAULT FALSE
 );
 COMMENT ON TABLE auditor_reserve_in_inconsistency
diff --git a/src/auditordb/pg_insert_reserve_in_inconsistency.c 
b/src/auditordb/pg_insert_reserve_in_inconsistency.c
index 9c98b7ace..f92249049 100644
--- a/src/auditordb/pg_insert_reserve_in_inconsistency.c
+++ b/src/auditordb/pg_insert_reserve_in_inconsistency.c
@@ -28,22 +28,22 @@ TAH_PG_insert_reserve_in_inconsistency (
 {
   struct PostgresClosure *pg = cls;
   struct GNUNET_PQ_QueryParam params[] = {
-
-    TALER_PQ_query_param_amount (pg->conn, &dc->amount_exchange_expected),
-    TALER_PQ_query_param_amount (pg->conn, &dc->amount_wired),
+    GNUNET_PQ_query_param_uint64 (&dc->bank_row_id),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &dc->amount_exchange_expected),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &dc->amount_wired),
     GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub),
     GNUNET_PQ_query_param_absolute_time (&dc->timestamp),
     GNUNET_PQ_query_param_auto_from_type (&dc->account),
     GNUNET_PQ_query_param_auto_from_type (&dc->diagnostic),
-
-
     GNUNET_PQ_query_param_end
   };
 
   PREPARE (pg,
            "auditor_reserve_in_inconsistency_insert",
            "INSERT INTO auditor_reserve_in_inconsistency "
-           "( row_id,"
+           "(bank_row_id,"
            " amount_exchange_expected,"
            " amount_wired,"
            " reserve_pub,"
diff --git a/src/include/taler_auditordb_plugin.h 
b/src/include/taler_auditordb_plugin.h
index 3a5ef2210..430fad9d0 100644
--- a/src/include/taler_auditordb_plugin.h
+++ b/src/include/taler_auditordb_plugin.h
@@ -369,7 +369,7 @@ struct 
TALER_AUDITORDB_ReserveBalanceInsufficientInconsistency
  */
 struct TALER_AUDITORDB_ReserveInInconsistency
 {
-  uint64_t row_id;
+  uint64_t bank_row_id;
   struct TALER_Amount amount_exchange_expected;
   struct TALER_Amount amount_wired;
   struct TALER_ReservePublicKeyP reserve_pub;

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