[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 121/151: first test passes, party
From: |
gnunet |
Subject: |
[taler-exchange] 121/151: first test passes, party |
Date: |
Tue, 30 Jul 2024 23:38:11 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit d825ef10974b1a9087874f289985f988e2e1b440
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] 113/151: wip, (continued)
- [taler-exchange] 113/151: wip, gnunet, 2024/07/30
- [taler-exchange] 105/151: fix kyc trigger SQL logic, gnunet, 2024/07/30
- [taler-exchange] 110/151: add new CMDs for KYC info+start, gnunet, 2024/07/30
- [taler-exchange] 69/151: -towards form uploads (incomplete), gnunet, 2024/07/30
- [taler-exchange] 94/151: -work on tests, gnunet, 2024/07/30
- [taler-exchange] 28/151: -add kyc data back for lookup_transfer_by_deposit, gnunet, 2024/07/30
- [taler-exchange] 100/151: more parsing, config template, gnunet, 2024/07/30
- [taler-exchange] 99/151: parse more of check configuration, gnunet, 2024/07/30
- [taler-exchange] 129/151: -fix SQL bugs, gnunet, 2024/07/30
- [taler-exchange] 120/151: -misc bugfixes, gnunet, 2024/07/30
- [taler-exchange] 121/151: first test passes, party,
gnunet <=
- [taler-exchange] 143/151: investigate..., gnunet, 2024/07/30
- [taler-exchange] 141/151: -bugfixes, gnunet, 2024/07/30
- [taler-exchange] 147/151: doxygen fixes, gnunet, 2024/07/30
- [taler-exchange] 134/151: fix track transfer, gnunet, 2024/07/30
- [taler-exchange] 118/151: -fix FTBFS, gnunet, 2024/07/30
- [taler-exchange] 144/151: DCE, fix some doxygen issues, gnunet, 2024/07/30
- [taler-exchange] 123/151: -fix age withdraw test, gnunet, 2024/07/30
- [taler-exchange] 149/151: more work on AML tests, gnunet, 2024/07/30
- [taler-exchange] 151/151: possibly final test_kyc_api fixes, gnunet, 2024/07/30
- [taler-exchange] 137/151: fix push/pull of test_kyc_api, gnunet, 2024/07/30