aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-11-09 20:36:30 +0100
committerChristian Grothoff <christian@grothoff.org>2021-11-09 20:36:30 +0100
commit016551dbb4af5de4725fb67787dff07c852c0280 (patch)
treed7199334658b8caaa51307ddff69d4fe1bb0a661 /src/testing
parenta9b2140b1ece806847aa45a6b95a959c9ddaa7bf (diff)
misc TODOs for KYC left
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_kyc_api.c55
-rw-r--r--src/testing/test_kyc_api.conf2
-rw-r--r--src/testing/testing_api_cmd_kyc_wallet_get.c3
3 files changed, 54 insertions, 6 deletions
diff --git a/src/testing/test_kyc_api.c b/src/testing/test_kyc_api.c
index b1a43df56..48464e2f6 100644
--- a/src/testing/test_kyc_api.c
+++ b/src/testing/test_kyc_api.c
@@ -96,24 +96,48 @@ run (void *cls,
*/
struct TALER_TESTING_Command withdraw[] = {
CMD_TRANSFER_TO_EXCHANGE ("create-reserve-1",
- "EUR:5.01"),
+ "EUR:15.02"),
TALER_TESTING_cmd_check_bank_admin_transfer (
"check-create-reserve-1",
- "EUR:5.01", bc.user42_payto, bc.exchange_payto,
+ "EUR:15.02", bc.user42_payto, bc.exchange_payto,
"create-reserve-1"),
CMD_EXEC_WIREWATCH ("wirewatch-1"),
+ TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1-no-kyc",
+ "create-reserve-1",
+ "EUR:10",
+ MHD_HTTP_ACCEPTED),
TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1",
"create-reserve-1",
"EUR:5",
MHD_HTTP_OK),
TALER_TESTING_cmd_end ()
};
+ /**
+ * Test withdraw with KYC.
+ */
+ struct TALER_TESTING_Command withdraw_kyc[] = {
+ CMD_EXEC_WIREWATCH ("wirewatch-1"),
+ TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1-lacking-kyc",
+ "create-reserve-1",
+ "EUR:5",
+ MHD_HTTP_ACCEPTED),
+ TALER_TESTING_cmd_proof_kyc ("proof-kyc",
+ "withdraw-coin-1-lacking-kyc",
+ "pass",
+ "state",
+ MHD_HTTP_SEE_OTHER),
+ TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1-with-kyc",
+ "create-reserve-1",
+ "EUR:5",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_end ()
+ };
struct TALER_TESTING_Command spend[] = {
TALER_TESTING_cmd_deposit (
"deposit-simple",
"withdraw-coin-1",
0,
- bc.user42_payto,
+ bc.user43_payto,
"{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
GNUNET_TIME_UNIT_ZERO,
"EUR:5",
@@ -156,11 +180,28 @@ run (void *cls,
ec.exchange_url,
"EUR:4.98",
bc.exchange_payto,
- bc.user42_payto),
+ bc.user43_payto),
TALER_TESTING_cmd_check_bank_empty ("check_bank_empty"),
TALER_TESTING_cmd_end ()
};
+ struct TALER_TESTING_Command wallet_kyc[] = {
+ TALER_TESTING_cmd_wallet_kyc_get (
+ "wallet-kyc-fail",
+ NULL,
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_proof_kyc ("proof-wallet-kyc",
+ "wallet-kyc-fail",
+ "pass",
+ "state",
+ MHD_HTTP_SEE_OTHER),
+ TALER_TESTING_cmd_check_kyc_get (
+ "wallet-kyc-check",
+ "wallet-kyc-fail",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_end ()
+ };
+
struct TALER_TESTING_Command commands[] = {
TALER_TESTING_cmd_exec_offline_sign_fees ("offline-sign-fees",
CONFIG_FILE,
@@ -183,6 +224,12 @@ run (void *cls,
spend),
TALER_TESTING_cmd_batch ("track",
track),
+ TALER_TESTING_cmd_batch ("withdraw-kyc",
+ withdraw_kyc),
+#if 0
+ TALER_TESTING_cmd_batch ("wallet-kyc",
+ wallet_kyc),
+#endif
TALER_TESTING_cmd_end ()
};
diff --git a/src/testing/test_kyc_api.conf b/src/testing/test_kyc_api.conf
index 105ee3b26..ebc2016b6 100644
--- a/src/testing/test_kyc_api.conf
+++ b/src/testing/test_kyc_api.conf
@@ -52,7 +52,7 @@ KYC_WALLET_BALANCE_LIMIT = EUR:1
KYC_WITHDRAW_PERIOD = "31 days"
-KYC_WITHDRAW_LIMIT = EUR:150
+KYC_WITHDRAW_LIMIT = EUR:8
[exchange-kyc-oauth2]
diff --git a/src/testing/testing_api_cmd_kyc_wallet_get.c b/src/testing/testing_api_cmd_kyc_wallet_get.c
index 44ca03719..e487f6285 100644
--- a/src/testing/testing_api_cmd_kyc_wallet_get.c
+++ b/src/testing/testing_api_cmd_kyc_wallet_get.c
@@ -94,9 +94,10 @@ wallet_kyc_cb (void *cls,
if (kwg->expected_response_code != wkr->http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u/%d to command %s in %s:%u\n",
+ "Unexpected response code %u/%d (wanted %u) to command %s in %s:%u\n",
wkr->http_status,
(int) wkr->ec,
+ kwg->expected_response_code,
cmd->label,
__FILE__,
__LINE__);