summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_delete_account.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-09-01 14:27:48 +0200
committerChristian Grothoff <grothoff@gnunet.org>2023-09-01 14:27:48 +0200
commit35dcd4514a93ba0f5353ecd1194fc9b515f2aad4 (patch)
tree399d8f8fbebf5e8ac383fc318b7be08901279a31 /src/testing/testing_api_cmd_delete_account.c
parent858e3047b8b595ab693e16ce0bbe0b8983b072ed (diff)
downloadmerchant-35dcd4514a93ba0f5353ecd1194fc9b515f2aad4.tar.gz
merchant-35dcd4514a93ba0f5353ecd1194fc9b515f2aad4.tar.bz2
merchant-35dcd4514a93ba0f5353ecd1194fc9b515f2aad4.zip
new CRUD APIs for OTP devices and merchant accounts (fixes #7929, #7824), one minor test is still failing...
Diffstat (limited to 'src/testing/testing_api_cmd_delete_account.c')
-rw-r--r--src/testing/testing_api_cmd_delete_account.c56
1 files changed, 13 insertions, 43 deletions
diff --git a/src/testing/testing_api_cmd_delete_account.c b/src/testing/testing_api_cmd_delete_account.c
index 1490dc31..681faa3c 100644
--- a/src/testing/testing_api_cmd_delete_account.c
+++ b/src/testing/testing_api_cmd_delete_account.c
@@ -29,7 +29,7 @@
/**
- * State of a "DELETE /accounts/$ID" CMD.
+ * State of a "DELETE /accounts/$H_WIRE" CMD.
*/
struct DeleteAccountState
{
@@ -52,12 +52,7 @@ struct DeleteAccountState
/**
* ID of the command to get account details from.
*/
- const char *get_instance_ref;
-
- /**
- * Payto URI to extract h_wire from.
- */
- const char *payto_uri;
+ const char *create_account_ref;
/**
* Expected HTTP response code.
@@ -128,7 +123,7 @@ delete_account_run (void *cls,
das->is = is;
ref = TALER_TESTING_interpreter_lookup_command (is,
- das->get_instance_ref);
+ das->create_account_ref);
if (NULL == ref)
{
GNUNET_break (0);
@@ -141,45 +136,22 @@ delete_account_run (void *cls,
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Command %s lacked merchant base URL\n",
- das->get_instance_ref);
+ das->create_account_ref);
GNUNET_break (0);
TALER_TESTING_FAIL (is);
return;
}
- for (unsigned int i = 0; i<UINT_MAX; i++)
+ if (GNUNET_OK !=
+ TALER_TESTING_get_trait_h_wires (ref,
+ 0,
+ &h_wire))
{
- const char *payto_uri;
-
- if (GNUNET_OK !=
- TALER_TESTING_get_trait_payto_uris (ref,
- i,
- &payto_uri))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Command %s did not return payto URI %s\n",
- das->get_instance_ref,
- das->payto_uri);
- GNUNET_break (0);
- TALER_TESTING_FAIL (is);
- return;
- }
- if (0 != strcmp (payto_uri,
- das->payto_uri))
- continue; /* different account */
- if (GNUNET_OK !=
- TALER_TESTING_get_trait_h_wires (ref,
- i,
- &h_wire))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Command %s had payto URI %s but lacked h_wire!?\n",
- das->get_instance_ref,
- das->payto_uri);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Command %s did not return H_WIRE\n",
+ das->create_account_ref);
GNUNET_break (0);
TALER_TESTING_FAIL (is);
return;
- }
- break;
}
GNUNET_assert (NULL != h_wire);
das->adh = TALER_MERCHANT_account_delete (
@@ -217,15 +189,13 @@ delete_account_cleanup (void *cls,
struct TALER_TESTING_Command
TALER_TESTING_cmd_merchant_delete_account (const char *label,
- const char *get_instance_ref,
- const char *payto_uri,
+ const char *create_account_ref,
unsigned int http_status)
{
struct DeleteAccountState *das;
das = GNUNET_new (struct DeleteAccountState);
- das->get_instance_ref = get_instance_ref;
- das->payto_uri = payto_uri;
+ das->create_account_ref = create_account_ref;
das->http_status = http_status;
{
struct TALER_TESTING_Command cmd = {