exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 6d22968e8ec7190f1d85e5f7f30905a0e4be56f0
parent f8af97b95b487b8e36eeea49500bb248583d32e6
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 30 Jul 2024 21:28:55 +0200

-more AML test logic

Diffstat:
Msrc/exchange/taler-exchange-httpd_aml-decisions-get.c | 27+++++++++++++++++++++++++++
Msrc/testing/test_kyc_api.c | 44++++++++++----------------------------------
2 files changed, 37 insertions(+), 34 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_aml-decisions-get.c b/src/exchange/taler-exchange-httpd_aml-decisions-get.c @@ -138,6 +138,33 @@ TEH_handler_aml_decisions_get ( TALER_EXCHANGE_YNA_ALL, &investigation_filter); { + enum GNUNET_DB_QueryStatus qs; + + qs = TEH_plugin->test_aml_officer (TEH_plugin->cls, + officer_pub); + switch (qs) + { + case GNUNET_DB_STATUS_HARD_ERROR: + case GNUNET_DB_STATUS_SOFT_ERROR: + GNUNET_break (0); + return TALER_MHD_reply_with_error ( + rc->connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_GENERIC_DB_FETCH_FAILED, + "test_aml_officer"); + case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: + GNUNET_break_op (0); + return TALER_MHD_reply_static ( + rc->connection, + MHD_HTTP_FORBIDDEN, + NULL, + NULL, + 0); + case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: + break; + } + } + { json_t *records; enum GNUNET_DB_QueryStatus qs; diff --git a/src/testing/test_kyc_api.c b/src/testing/test_kyc_api.c @@ -637,44 +637,22 @@ run (void *cls, TALER_TESTING_cmd_check_aml_decisions ( "check-decisions-one-normal", "create-aml-officer-1", - TALER_AML_NORMAL, - MHD_HTTP_OK), - TALER_TESTING_cmd_check_aml_decisions ( - "check-decisions-zero-frozen", - "create-aml-officer-1", - TALER_AML_FROZEN, - MHD_HTTP_NO_CONTENT), - TALER_TESTING_cmd_check_aml_decision ( - "check-aml-decision", - "create-aml-officer-1", "aml-decide", MHD_HTTP_OK), - TALER_TESTING_cmd_sleep ( - "sleep-1c", - 1), - TALER_TESTING_cmd_take_aml_decision ( - "aml-decide-freeze", - "create-aml-officer-1", + TALER_TESTING_cmd_wallet_kyc_get ( "wallet-trigger-kyc-for-aml", - "EUR:1000", - "party over", - TALER_AML_FROZEN, NULL, + "EUR:1000", MHD_HTTP_NO_CONTENT), - TALER_TESTING_cmd_check_aml_decisions ( - "check-decisions-one-frozen", - "create-aml-officer-1", - TALER_AML_FROZEN, - MHD_HTTP_OK), - TALER_TESTING_cmd_check_aml_decisions ( - "check-decisions-zero-normal", - "create-aml-officer-1", - TALER_AML_NORMAL, - MHD_HTTP_NO_CONTENT), + TALER_TESTING_cmd_wallet_kyc_get ( + "wallet-trigger-kyc-for-aml", + NULL, + "EUR:20000", + MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS), +#endif TALER_TESTING_cmd_sleep ( "sleep-1d", 1), -#endif TALER_TESTING_cmd_set_officer ( "create-aml-officer-1-disable", "create-aml-officer-1", @@ -683,13 +661,11 @@ run (void *cls, true), /* Test that we are NOT allowed to read AML decisions now that our AML staff account is disabled */ -#if FIXME - TALER_TESTING_cmd_check_aml_decision ( + TALER_TESTING_cmd_check_aml_decisions ( "check-aml-decision-disabled", "create-aml-officer-1", "aml-decide", MHD_HTTP_FORBIDDEN), -#endif TALER_TESTING_cmd_end () }; @@ -709,7 +685,7 @@ run (void *cls, NULL, true, true), -#if DISABLED || 1 +#if DISABLED || 0 TALER_TESTING_cmd_batch ( "withdraw", withdraw),