aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-07-30 21:12:55 +0200
committerChristian Grothoff <christian@grothoff.org>2024-07-30 21:12:55 +0200
commitf8af97b95b487b8e36eeea49500bb248583d32e6 (patch)
tree76059f4823b356cdd19b9433b1a98aaff412e58d
parentcb0c8cbc4492b49e5aaf6599aef6761065b3e564 (diff)
more work on AML tests
-rw-r--r--src/lib/exchange_api_add_aml_decision.c4
-rw-r--r--src/testing/test_kyc_api.c28
-rw-r--r--src/testing/testing_api_cmd_take_aml_decision.c14
3 files changed, 33 insertions, 13 deletions
diff --git a/src/lib/exchange_api_add_aml_decision.c b/src/lib/exchange_api_add_aml_decision.c
index 6ffae55db..74d7ed09c 100644
--- a/src/lib/exchange_api_add_aml_decision.c
+++ b/src/lib/exchange_api_add_aml_decision.c
@@ -217,8 +217,8 @@ TALER_EXCHANGE_add_aml_decision (
successor_measure)),
GNUNET_JSON_pack_array_steal ("rules",
jrules),
- GNUNET_JSON_pack_array_steal ("custom_measures",
- jmeasures)
+ GNUNET_JSON_pack_object_steal ("custom_measures",
+ jmeasures)
);
GNUNET_CRYPTO_eddsa_key_get_public (&officer_priv->eddsa_priv,
diff --git a/src/testing/test_kyc_api.c b/src/testing/test_kyc_api.c
index 165b85131..6657f42ca 100644
--- a/src/testing/test_kyc_api.c
+++ b/src/testing/test_kyc_api.c
@@ -583,7 +583,6 @@ run (void *cls,
#endif
/* Test that we are not allowed to take AML decisions as our
AML staff account is on read-only */
-#if FIXME
TALER_TESTING_cmd_take_aml_decision (
"aml-decide-while-disabled",
"create-aml-officer-1",
@@ -591,18 +590,23 @@ run (void *cls,
true /* keep investigating */,
GNUNET_TIME_UNIT_HOURS /* expiration */,
NULL /* successor measure: default */,
- "{\"threshold\":\"EUR:10000\"}" /* new rules */,
+ "{\"rules\":["
+ "{\"timeframe\":{\"d_us\":3600000000},"
+ " \"threshold\":\"EUR:10000\","
+ " \"operation_type\":\"BALANCE\","
+ " \"verboten\":true"
+ "}"
+ "]}" /* new rules */,
"{}" /* properties */,
"party time",
MHD_HTTP_FORBIDDEN),
/* Check that no decision was taken, but that we are allowed
to read this information */
- TALER_TESTING_cmd_check_aml_decision (
+ TALER_TESTING_cmd_check_aml_decisions (
"check-aml-decision-empty",
"create-aml-officer-1",
"aml-decide-while-disabled",
MHD_HTTP_NO_CONTENT),
-#endif
TALER_TESTING_cmd_sleep (
"sleep-1b",
1),
@@ -612,16 +616,24 @@ run (void *cls,
"Peter Falk",
true,
false),
-#if FIXME
TALER_TESTING_cmd_take_aml_decision (
"aml-decide",
"create-aml-officer-1",
"wallet-trigger-kyc-for-aml",
- "EUR:10000",
+ true /* keep investigating */,
+ GNUNET_TIME_UNIT_HOURS /* expiration */,
+ NULL /* successor measure: default */,
+ "{\"rules\":["
+ "{\"timeframe\":{\"d_us\":3600000000},"
+ " \"threshold\":\"EUR:10000\","
+ " \"operation_type\":\"BALANCE\","
+ " \"verboten\":true"
+ "}"
+ "]}" /* new rules */,
+ "{}" /* properties */,
"party time",
- TALER_AML_NORMAL,
- NULL,
MHD_HTTP_NO_CONTENT),
+#if FIXME
TALER_TESTING_cmd_check_aml_decisions (
"check-decisions-one-normal",
"create-aml-officer-1",
diff --git a/src/testing/testing_api_cmd_take_aml_decision.c b/src/testing/testing_api_cmd_take_aml_decision.c
index 22a1d0795..2008350c5 100644
--- a/src/testing/testing_api_cmd_take_aml_decision.c
+++ b/src/testing/testing_api_cmd_take_aml_decision.c
@@ -146,14 +146,16 @@ take_aml_decision_run (void *cls,
const struct TALER_TESTING_Command *ref;
const char *exchange_url;
const json_t *jrules;
- const json_t *jmeasures;
+ const json_t *jmeasures = NULL;
struct GNUNET_TIME_Timestamp expiration_time
= GNUNET_TIME_relative_to_timestamp (ds->expiration_delay);
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_array_const ("rules",
&jrules),
- GNUNET_JSON_spec_object_const ("custom_measures",
- &jmeasures),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_object_const ("custom_measures",
+ &jmeasures),
+ NULL),
GNUNET_JSON_spec_end ()
};
unsigned int num_rules;
@@ -475,6 +477,9 @@ TALER_TESTING_cmd_take_aml_decision (
"Invalid JSON in new rules of %s: %s\n",
label,
err.text);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Input was: `%s'\n",
+ new_rules);
GNUNET_assert (0);
}
GNUNET_assert (NULL != ds->new_rules);
@@ -487,6 +492,9 @@ TALER_TESTING_cmd_take_aml_decision (
"Invalid JSON in properties of %s: %s\n",
label,
err.text);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Input was: `%s'\n",
+ properties);
GNUNET_assert (0);
}
ds->justification = justification;