aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-02-04 16:01:46 +0100
committerChristian Grothoff <christian@grothoff.org>2023-02-04 16:01:46 +0100
commit19da4bd63868a4c46959198ef95e4a8e1af38b77 (patch)
tree1b77d20b085e9835e750091e66e3d510972a27ab /src/lib
parentc3243aa39f924921e8bf52fe6290e4d738d6a20e (diff)
add tests for new AML logic, plus related bugfixes
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/exchange_api_add_aml_decision.c2
-rw-r--r--src/lib/exchange_api_lookup_aml_decision.c10
-rw-r--r--src/lib/exchange_api_lookup_aml_decisions.c10
3 files changed, 17 insertions, 5 deletions
diff --git a/src/lib/exchange_api_add_aml_decision.c b/src/lib/exchange_api_add_aml_decision.c
index 0a1b70cdf..5e5383f25 100644
--- a/src/lib/exchange_api_add_aml_decision.c
+++ b/src/lib/exchange_api_add_aml_decision.c
@@ -188,7 +188,7 @@ TALER_EXCHANGE_add_aml_decision (
&officer_sig),
GNUNET_JSON_pack_data_auto ("h_payto",
h_payto),
- GNUNET_JSON_pack_uint64 ("state",
+ GNUNET_JSON_pack_uint64 ("new_state",
(uint32_t) new_state),
TALER_JSON_pack_amount ("new_threshold",
new_threshold),
diff --git a/src/lib/exchange_api_lookup_aml_decision.c b/src/lib/exchange_api_lookup_aml_decision.c
index 409a35c08..897a21f10 100644
--- a/src/lib/exchange_api_lookup_aml_decision.c
+++ b/src/lib/exchange_api_lookup_aml_decision.c
@@ -262,6 +262,12 @@ handle_lookup_finished (void *cls,
/* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
+ case MHD_HTTP_FORBIDDEN:
+ lr.hr.ec = TALER_JSON_get_error_code (j);
+ lr.hr.hint = TALER_JSON_get_error_hint (j);
+ /* Nothing really to verify, exchange says this coin was not melted; we
+ should pass the JSON reply to the application */
+ break;
case MHD_HTTP_NOT_FOUND:
lr.hr.ec = TALER_JSON_get_error_code (j);
lr.hr.hint = TALER_JSON_get_error_hint (j);
@@ -280,7 +286,7 @@ handle_lookup_finished (void *cls,
lr.hr.ec = TALER_JSON_get_error_code (j);
lr.hr.hint = TALER_JSON_get_error_hint (j);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u/%d for exchange link\n",
+ "Unexpected response code %u/%d for exchange lookup AML decision\n",
(unsigned int) response_code,
(int) lr.hr.ec);
break;
@@ -332,7 +338,7 @@ TALER_EXCHANGE_lookup_aml_decision (
*end = '\0';
GNUNET_snprintf (arg_str,
sizeof (arg_str),
- "/aml/%s/decision/%s",
+ "aml/%s/decision/%s",
pub_str,
pt_str);
}
diff --git a/src/lib/exchange_api_lookup_aml_decisions.c b/src/lib/exchange_api_lookup_aml_decisions.c
index da17aa784..3b1db4556 100644
--- a/src/lib/exchange_api_lookup_aml_decisions.c
+++ b/src/lib/exchange_api_lookup_aml_decisions.c
@@ -202,6 +202,12 @@ handle_lookup_finished (void *cls,
/* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
+ case MHD_HTTP_FORBIDDEN:
+ lr.hr.ec = TALER_JSON_get_error_code (j);
+ lr.hr.hint = TALER_JSON_get_error_hint (j);
+ /* Nothing really to verify, exchange says this coin was not melted; we
+ should pass the JSON reply to the application */
+ break;
case MHD_HTTP_NOT_FOUND:
lr.hr.ec = TALER_JSON_get_error_code (j);
lr.hr.hint = TALER_JSON_get_error_hint (j);
@@ -220,7 +226,7 @@ handle_lookup_finished (void *cls,
lr.hr.ec = TALER_JSON_get_error_code (j);
lr.hr.hint = TALER_JSON_get_error_hint (j);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u/%d for exchange link\n",
+ "Unexpected response code %u/%d for lookup AML decisions\n",
(unsigned int) response_code,
(int) lr.hr.ec);
break;
@@ -279,7 +285,7 @@ TALER_EXCHANGE_lookup_aml_decisions (
*end = '\0';
GNUNET_snprintf (arg_str,
sizeof (arg_str),
- "/aml/%s/decisions/%s",
+ "aml/%s/decisions/%s",
pub_str,
state_str);
}