[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 121/124: first test passes, party
From: |
gnunet |
Subject: |
[taler-exchange] 121/124: first test passes, party |
Date: |
Tue, 17 Sep 2024 21:28:53 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to tag cg-aml-branch-compiles
in repository exchange.
commit e5cbf86e7a4bce68643735a91d65943dc6b93cc8
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Jul 25 17:13:40 2024 +0200
first test passes, party
---
.../exchange_do_insert_kyc_attributes.sql | 34 ++++++++++------------
src/exchangedb/pg_insert_kyc_attributes.c | 7 ++++-
2 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/src/exchangedb/exchange_do_insert_kyc_attributes.sql
b/src/exchangedb/exchange_do_insert_kyc_attributes.sql
index 3a50b1824..12f76c17d 100644
--- a/src/exchangedb/exchange_do_insert_kyc_attributes.sql
+++ b/src/exchangedb/exchange_do_insert_kyc_attributes.sql
@@ -35,8 +35,6 @@ CREATE FUNCTION exchange_do_insert_kyc_attributes(
LANGUAGE plpgsql
AS $$
DECLARE
- orig_reserve_pub BYTEA;
- orig_reserve_found BOOLEAN;
my_trigger_outcome_serial INT8;
my_lmsi INT8;
my_i INT4;
@@ -87,7 +85,7 @@ UPDATE legitimization_processes
AND provider_name=in_provider_name
RETURNING legitimization_measure_serial_id
INTO my_lmsi;
-out_ok = FOUND;
+out_ok=FOUND;
IF out_ok
THEN
@@ -96,25 +94,23 @@ THEN
WHERE legitimization_measure_serial_id=my_lmsi;
END IF;
--- If the h_payto refers to a reserve in the original requirements
--- update the originating reserve's birthday.
-SELECT reserve_pub
- INTO orig_reserve_pub
- FROM exchange.legitimization_requirements
- WHERE h_payto=in_h_payto
- AND NOT reserve_pub IS NULL;
-orig_reserve_found = FOUND;
+UPDATE reserves
+ SET birthday=in_birthday
+ WHERE (reserve_pub IN
+ (SELECT reserve_pub
+ FROM reserves_in
+ WHERE wire_source_h_payto=in_h_payto) )
+-- The next 3 clauses primarily serve to limit
+-- unnecessary updates for reserves we do not
+-- care about anymore.
+ AND ( ((current_balance).frac > 0) OR
+ ((current_balance).val > 0 ) )
+ AND (expiration_date > in_collection_time_ts);
-IF orig_reserve_found
-THEN
- UPDATE exchange.reserves
- SET birthday=in_birthday
- WHERE reserve_pub=orig_reserve_pub;
-END IF;
IF in_to_investigate
THEN
- INSERT INTO exchange.aml_status
+ INSERT INTO aml_status
(h_payto
,status)
VALUES
@@ -124,7 +120,7 @@ THEN
UPDATE SET status=EXCLUDED.status | 1;
END IF;
-FOR i IN 1..array_length(ina_events,1)
+FOR i IN 1..COALESCE(array_length(ina_events,1),0)
LOOP
ini_event = ina_events[i];
INSERT INTO kyc_events
diff --git a/src/exchangedb/pg_insert_kyc_attributes.c
b/src/exchangedb/pg_insert_kyc_attributes.c
index ba0843e19..11fac71e5 100644
--- a/src/exchangedb/pg_insert_kyc_attributes.c
+++ b/src/exchangedb/pg_insert_kyc_attributes.c
@@ -76,7 +76,9 @@ TEH_PG_insert_kyc_attributes (
GNUNET_PQ_query_param_timestamp (&collection_time),
GNUNET_PQ_query_param_absolute_time (&expiration_time),
GNUNET_PQ_query_param_timestamp (&expiration),
- TALER_PQ_query_param_json (account_properties),
+ NULL == account_properties
+ ? GNUNET_PQ_query_param_null ()
+ : TALER_PQ_query_param_json (account_properties),
TALER_PQ_query_param_json (new_rules),
GNUNET_PQ_query_param_array_ptrs_string (num_events,
events,
@@ -98,6 +100,9 @@ TEH_PG_insert_kyc_attributes (
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Inserting KYC attributes, wake up on %s\n",
kyc_completed_notify_s);
+ GNUNET_break (NULL != new_rules);
+ GNUNET_break (NULL != h_payto);
+ GNUNET_break (NULL != enc_attributes);
PREPARE (pg,
"insert_kyc_attributes",
"SELECT "
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] 89/124: -improve logging, (continued)
- [taler-exchange] 89/124: -improve logging, gnunet, 2024/09/17
- [taler-exchange] 83/124: seems done, gnunet, 2024/09/17
- [taler-exchange] 94/124: -work on tests, gnunet, 2024/09/17
- [taler-exchange] 85/124: set timeout also for curl request, gnunet, 2024/09/17
- [taler-exchange] 105/124: fix kyc trigger SQL logic, gnunet, 2024/09/17
- [taler-exchange] 100/124: more parsing, config template, gnunet, 2024/09/17
- [taler-exchange] 110/124: add new CMDs for KYC info+start, gnunet, 2024/09/17
- [taler-exchange] 111/124: -fix bugs, gnunet, 2024/09/17
- [taler-exchange] 114/124: fix FTBFS, gnunet, 2024/09/17
- [taler-exchange] 101/124: add some first KYC commands for testing, gnunet, 2024/09/17
- [taler-exchange] 121/124: first test passes, party,
gnunet <=
- [taler-exchange] 68/124: add kyc-upload logic to demultiplexer, gnunet, 2024/09/17
- [taler-exchange] 58/124: -more work on add decision, gnunet, 2024/09/17
- [taler-exchange] 52/124: drop functions after use, gnunet, 2024/09/17
- [taler-exchange] 103/124: add logic to parse new_check field, gnunet, 2024/09/17
- [taler-exchange] 73/124: init kyc-info subsystem, gnunet, 2024/09/17
- [taler-exchange] 108/124: do not pass timeout in test, gnunet, 2024/09/17
- [taler-exchange] 98/124: add logic to parse measures from configuration, gnunet, 2024/09/17
- [taler-exchange] 113/124: wip, gnunet, 2024/09/17
- [taler-exchange] 107/124: -fix small bugs, gnunet, 2024/09/17