summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_set_officer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_set_officer.c')
-rw-r--r--src/testing/testing_api_cmd_set_officer.c71
1 files changed, 47 insertions, 24 deletions
diff --git a/src/testing/testing_api_cmd_set_officer.c b/src/testing/testing_api_cmd_set_officer.c
index 1c0495f32..f2464c8a9 100644
--- a/src/testing/testing_api_cmd_set_officer.c
+++ b/src/testing/testing_api_cmd_set_officer.c
@@ -97,16 +97,8 @@ set_officer_cb (void *cls,
ds->dh = NULL;
if (MHD_HTTP_NO_CONTENT != hr->http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Unexpected response code %u to command %s in %s:%u\n",
- hr->http_status,
- ds->is->commands[ds->is->ip].label,
- __FILE__,
- __LINE__);
- json_dumpf (hr->reply,
- stderr,
- 0);
- TALER_TESTING_interpreter_fail (ds->is);
+ TALER_TESTING_unexpected_status (ds->is,
+ hr->http_status);
return;
}
TALER_TESTING_interpreter_next (ds->is);
@@ -128,8 +120,24 @@ set_officer_run (void *cls,
struct SetOfficerState *ds = cls;
struct GNUNET_TIME_Timestamp now;
struct TALER_MasterSignatureP master_sig;
+ const char *exchange_url;
(void) cmd;
+ {
+ const struct TALER_TESTING_Command *exchange_cmd;
+
+ exchange_cmd = TALER_TESTING_interpreter_get_command (is,
+ "exchange");
+ if (NULL == exchange_cmd)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ GNUNET_assert (GNUNET_OK ==
+ TALER_TESTING_get_trait_exchange_url (exchange_cmd,
+ &exchange_url));
+ }
now = GNUNET_TIME_timestamp_get ();
ds->is = is;
if (NULL == ds->ref_cmd)
@@ -161,16 +169,33 @@ set_officer_run (void *cls,
ds->officer_pub = *officer_pub;
ds->officer_priv = *officer_priv;
}
- TALER_exchange_offline_aml_officer_status_sign (&ds->officer_pub,
- ds->name,
- now,
- ds->is_active,
- ds->read_only,
- &is->master_priv,
- &master_sig);
+ {
+ const struct TALER_TESTING_Command *exchange_cmd;
+ const struct TALER_MasterPrivateKeyP *master_priv;
+
+ exchange_cmd = TALER_TESTING_interpreter_get_command (is,
+ "exchange");
+ if (NULL == exchange_cmd)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ GNUNET_assert (GNUNET_OK ==
+ TALER_TESTING_get_trait_master_priv (exchange_cmd,
+ &master_priv));
+
+ TALER_exchange_offline_aml_officer_status_sign (&ds->officer_pub,
+ ds->name,
+ now,
+ ds->is_active,
+ ds->read_only,
+ master_priv,
+ &master_sig);
+ }
ds->dh = TALER_EXCHANGE_management_update_aml_officer (
- is->ctx,
- is->exchange_url,
+ TALER_TESTING_interpreter_get_context (is),
+ exchange_url,
&ds->officer_pub,
ds->name,
now,
@@ -203,10 +228,8 @@ set_officer_cleanup (void *cls,
if (NULL != ds->dh)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Command %u (%s) did not complete\n",
- ds->is->ip,
- cmd->label);
+ TALER_TESTING_command_incomplete (ds->is,
+ cmd->label);
TALER_EXCHANGE_management_update_aml_officer_cancel (ds->dh);
ds->dh = NULL;
}
@@ -234,7 +257,7 @@ set_officer_traits (void *cls,
struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_officer_pub (&ws->officer_pub),
TALER_TESTING_make_trait_officer_priv (&ws->officer_priv),
- TALER_TESTING_make_trait_officer_name (&ws->name),
+ TALER_TESTING_make_trait_officer_name (ws->name),
TALER_TESTING_trait_end ()
};