[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 111/124: -fix bugs
From: |
gnunet |
Subject: |
[taler-exchange] 111/124: -fix bugs |
Date: |
Tue, 17 Sep 2024 21:28:43 +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 b3ff5a4e29e12b911be8031550225498a37f322c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jul 23 22:39:34 2024 +0200
-fix bugs
---
src/exchangedb/pg_lookup_pending_legitimization.c | 4 ++--
src/include/taler_exchange_service.h | 4 ----
src/lib/exchange_api_kyc_info.c | 18 +++++++-----------
src/testing/taler-unified-setup.sh | 2 +-
src/testing/test_exchange_p2p.c | 12 +++++++++---
5 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/src/exchangedb/pg_lookup_pending_legitimization.c
b/src/exchangedb/pg_lookup_pending_legitimization.c
index a02a34315..ffa36ff37 100644
--- a/src/exchangedb/pg_lookup_pending_legitimization.c
+++ b/src/exchangedb/pg_lookup_pending_legitimization.c
@@ -57,8 +57,8 @@ TEH_PG_lookup_pending_legitimization (
" JOIN wire_targets wt"
" ON (lm.access_token = wt.access_token)"
" WHERE legitimization_measure_serial_id=$1"
- " AND access_token=$1"
- " AND NOT is_finished;");
+ " AND lm.access_token=$2"
+ " AND NOT lm.is_finished;");
return GNUNET_PQ_eval_prepared_singleton_select (
pg->conn,
"lookup_pending_legitimization",
diff --git a/src/include/taler_exchange_service.h
b/src/include/taler_exchange_service.h
index 9918c1d49..18febf2ea 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -4381,10 +4381,6 @@ struct TALER_EXCHANGE_KycInfoHandle;
*/
struct TALER_EXCHANGE_RequirementInformation
{
- /**
- * Name of the requirement.
- */
- const char *name;
/**
* Which form should be run. Special values are
diff --git a/src/lib/exchange_api_kyc_info.c b/src/lib/exchange_api_kyc_info.c
index cd6868759..dc5823a33 100644
--- a/src/lib/exchange_api_kyc_info.c
+++ b/src/lib/exchange_api_kyc_info.c
@@ -78,10 +78,8 @@ parse_kyc_info_ok (struct TALER_EXCHANGE_KycInfoHandle *lh,
.hr.http_status = MHD_HTTP_OK
};
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_object_const ("requirements",
- &jrequirements),
- NULL),
+ GNUNET_JSON_spec_array_const ("requirements",
+ &jrequirements),
GNUNET_JSON_spec_bool ("is_and_combinator",
&lr.details.ok.is_and_combinator),
GNUNET_JSON_spec_mark_optional (
@@ -109,9 +107,9 @@ parse_kyc_info_ok (struct TALER_EXCHANGE_KycInfoHandle *lh,
return GNUNET_SYSERR;
}
lr.details.ok.requirements_length
- = json_object_size (jrequirements);
+ = json_array_size (jrequirements);
if ( ((size_t) lr.details.ok.requirements_length)
- != json_object_size (jrequirements))
+ != json_array_size (jrequirements))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
@@ -125,7 +123,7 @@ parse_kyc_info_ok (struct TALER_EXCHANGE_KycInfoHandle *lh,
const char *name;
const json_t *jreq;
const json_t *jvc;
- unsigned int off;
+ size_t off;
memset (vci,
0,
@@ -134,10 +132,9 @@ parse_kyc_info_ok (struct TALER_EXCHANGE_KycInfoHandle *lh,
0,
sizeof (requirements));
- off = 0;
- json_object_foreach ((json_t *) jrequirements, name, jreq)
+ json_array_foreach ((json_t *) jrequirements, off, jreq)
{
- struct TALER_EXCHANGE_RequirementInformation *req = &requirements[off++];
+ struct TALER_EXCHANGE_RequirementInformation *req = &requirements[off];
struct GNUNET_JSON_Specification ispec[] = {
GNUNET_JSON_spec_string ("form",
&req->form),
@@ -154,7 +151,6 @@ parse_kyc_info_ok (struct TALER_EXCHANGE_KycInfoHandle *lh,
GNUNET_JSON_spec_end ()
};
- req->name = name;
if (GNUNET_OK !=
GNUNET_JSON_parse (jreq,
ispec,
diff --git a/src/testing/taler-unified-setup.sh
b/src/testing/taler-unified-setup.sh
index 770785bd5..1d7a12584 100755
--- a/src/testing/taler-unified-setup.sh
+++ b/src/testing/taler-unified-setup.sh
@@ -518,7 +518,7 @@ then
-c "$CONF" \
-L "$LOGLEVEL" \
2> taler-exchange-secmod-cs.log &
- $USE_VALGRIND taler-exchange-httpd \
+ $USE_VALGRIND valgrind taler-exchange-httpd \
-c "$CONF" \
-L "$LOGLEVEL" 2> taler-exchange-httpd.log &
echo " DONE"
diff --git a/src/testing/test_exchange_p2p.c b/src/testing/test_exchange_p2p.c
index 51b677843..237b954d8 100644
--- a/src/testing/test_exchange_p2p.c
+++ b/src/testing/test_exchange_p2p.c
@@ -499,9 +499,15 @@ run (void *cls,
"reserve-101-close-kyc",
"setup-account-key",
MHD_HTTP_ACCEPTED),
- // FIXME: use GET kyc-info to GET status
- // FIXME: use POST kyc-start to initiate KYC
- // Then this can work:
+ TALER_TESTING_cmd_get_kyc_info (
+ "get-kyc-info",
+ "check-kyc-close-pending",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_post_kyc_start (
+ "start-kyc-process",
+ "get-kyc-info",
+ 0,
+ MHD_HTTP_OK),
TALER_TESTING_cmd_proof_kyc_oauth2 (
"proof-close-kyc",
"reserve-101-close-kyc",
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] 86/124: start with wire-gateway API v1 implementation, (continued)
- [taler-exchange] 86/124: start with wire-gateway API v1 implementation, gnunet, 2024/09/17
- [taler-exchange] 99/124: parse more of check configuration, gnunet, 2024/09/17
- [taler-exchange] 87/124: skeleton, gnunet, 2024/09/17
- [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 <=
- [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, 2024/09/17
- [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