gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -implement lookup aml staff


From: gnunet
Subject: [taler-exchange] branch master updated: -implement lookup aml staff
Date: Fri, 30 Dec 2022 20:35:06 +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 5754adc4 -implement lookup aml staff
5754adc4 is described below

commit 5754adc414eaca8dcc2de47b6fcc12e9d1979c12
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Dec 30 20:34:57 2022 +0100

    -implement lookup aml staff
---
 src/exchangedb/pg_insert_aml_decision.c |  2 +-
 src/exchangedb/pg_lookup_aml_officer.c  | 35 +++++++++++++++++++++++++++++++--
 src/exchangedb/pg_update_aml_officer.c  |  2 +-
 3 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/src/exchangedb/pg_insert_aml_decision.c 
b/src/exchangedb/pg_insert_aml_decision.c
index 94f30275..d046c87f 100644
--- a/src/exchangedb/pg_insert_aml_decision.c
+++ b/src/exchangedb/pg_insert_aml_decision.c
@@ -43,7 +43,7 @@ TEH_PG_insert_aml_decision (
     GNUNET_PQ_query_param_auto_from_type (h_payto),
     TALER_PQ_query_param_amount (new_threshold),
     GNUNET_PQ_query_param_uint32 (&ns),
-    GNUNET_PQ_query_param_timestamp (&decision_time),
+    GNUNET_PQ_query_param_absolute_time (&decision_time),
     GNUNET_PQ_query_param_string (justification),
     GNUNET_PQ_query_param_auto_from_type (decider_pub),
     GNUNET_PQ_query_param_auto_from_type (decider_sig),
diff --git a/src/exchangedb/pg_lookup_aml_officer.c 
b/src/exchangedb/pg_lookup_aml_officer.c
index 245a870e..c18e47ea 100644
--- a/src/exchangedb/pg_lookup_aml_officer.c
+++ b/src/exchangedb/pg_lookup_aml_officer.c
@@ -35,6 +35,37 @@ TEH_PG_lookup_aml_officer (
   bool *read_only,
   struct GNUNET_TIME_Absolute *last_change)
 {
-  GNUNET_break (0); // FIXME: not implemeted!
-  return GNUNET_DB_STATUS_HARD_ERROR;
+  struct PostgresClosure *pg = cls;
+  struct GNUNET_PQ_QueryParam params[] = {
+    GNUNET_PQ_query_param_auto_from_type (decider_pub),
+    GNUNET_PQ_query_param_end
+  };
+  struct GNUNET_PQ_ResultSpec rs[] = {
+    GNUNET_PQ_result_spec_auto_from_type ("master_sig",
+                                          master_sig),
+    GNUNET_PQ_result_spec_string ("decider_name",
+                                  decider_name),
+    GNUNET_PQ_result_spec_bool ("is_active",
+                                is_active),
+    GNUNET_PQ_result_spec_bool ("read_only",
+                                read_only),
+    GNUNET_PQ_result_spec_absolute_time ("last_change",
+                                         last_change),
+    GNUNET_PQ_result_spec_end
+  };
+
+  PREPARE (pg,
+           "lookup_aml_officer",
+           "SELECT "
+           " master_sig"
+           ",decider_name"
+           ",is_active"
+           ",read_only"
+           ",last_change"
+           " FROM aml_staff"
+           " WHERE decider_pub=$1;");
+  return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
+                                                   "lookup_aml_officer",
+                                                   params,
+                                                   rs);
 }
diff --git a/src/exchangedb/pg_update_aml_officer.c 
b/src/exchangedb/pg_update_aml_officer.c
index f756e6e2..2f5b0ff9 100644
--- a/src/exchangedb/pg_update_aml_officer.c
+++ b/src/exchangedb/pg_update_aml_officer.c
@@ -43,7 +43,7 @@ TEH_PG_update_aml_officer (
     GNUNET_PQ_query_param_string (decider_name),
     GNUNET_PQ_query_param_bool (is_active),
     GNUNET_PQ_query_param_bool (read_only),
-    GNUNET_PQ_query_param_timestamp (&last_change),
+    GNUNET_PQ_query_param_absolute_time (&last_change),
     GNUNET_PQ_query_param_end
   };
 

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