summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_get_auditor.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-06-21 09:00:58 +0200
committerChristian Grothoff <christian@grothoff.org>2023-06-21 09:00:58 +0200
commitf5ce22ddf6da6aae6a9077dba122013c1dbc55d9 (patch)
treedc80e36922103c8008fab36a825b1c0e3b1cae22 /src/testing/testing_api_cmd_get_auditor.c
parentaf77a2a178a818abe851e4e25e768e2c1963b49c (diff)
downloadexchange-f5ce22ddf6da6aae6a9077dba122013c1dbc55d9.tar.gz
exchange-f5ce22ddf6da6aae6a9077dba122013c1dbc55d9.tar.bz2
exchange-f5ce22ddf6da6aae6a9077dba122013c1dbc55d9.zip
-more clean up of auditor api: atomization complete
Diffstat (limited to 'src/testing/testing_api_cmd_get_auditor.c')
-rw-r--r--src/testing/testing_api_cmd_get_auditor.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/testing/testing_api_cmd_get_auditor.c b/src/testing/testing_api_cmd_get_auditor.c
index 2e9961c36..e1ae8ba54 100644
--- a/src/testing/testing_api_cmd_get_auditor.c
+++ b/src/testing/testing_api_cmd_get_auditor.c
@@ -49,9 +49,9 @@ struct GetAuditorState
struct TALER_TESTING_Interpreter *is;
/**
- * Auditor handle we produced.
+ * Auditor handle used to get the configuration.
*/
- struct TALER_AUDITOR_Handle *auditor;
+ struct TALER_AUDITOR_GetConfigHandle *auditor;
/**
* URL of the auditor.
@@ -75,16 +75,25 @@ struct GetAuditorState
static void
version_cb (
void *cls,
- const struct TALER_AUDITOR_VersionResponse *vr)
+ const struct TALER_AUDITOR_ConfigResponse *vr)
{
struct GetAuditorState *gas = cls;
+ gas->auditor = NULL;
if (MHD_HTTP_OK != vr->hr.http_status)
{
TALER_TESTING_unexpected_status (gas->is,
vr->hr.http_status);
return;
}
+ if ( (NULL != gas->priv_file) &&
+ (0 != GNUNET_memcmp (&gas->auditor_pub,
+ &vr->details.ok.vi.auditor_pub)) )
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (gas->is);
+ return;
+ }
TALER_TESTING_interpreter_next (gas->is);
}
@@ -126,10 +135,10 @@ get_auditor_run (void *cls,
}
gas->is = is;
gas->auditor
- = TALER_AUDITOR_connect (TALER_TESTING_interpreter_get_context (is),
- gas->auditor_url,
- &version_cb,
- gas);
+ = TALER_AUDITOR_get_config (TALER_TESTING_interpreter_get_context (is),
+ gas->auditor_url,
+ &version_cb,
+ gas);
if (NULL == gas->auditor)
{
GNUNET_break (0);
@@ -153,7 +162,8 @@ get_auditor_cleanup (void *cls,
if (NULL != gas->auditor)
{
- TALER_AUDITOR_disconnect (gas->auditor);
+ GNUNET_break (0);
+ TALER_AUDITOR_get_config_cancel (gas->auditor);
gas->auditor = NULL;
}
GNUNET_free (gas->priv_file);
@@ -182,7 +192,6 @@ get_auditor_traits (void *cls,
struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_auditor_priv (&gas->auditor_priv),
TALER_TESTING_make_trait_auditor_pub (&gas->auditor_pub),
- TALER_TESTING_make_trait_auditor (gas->auditor),
TALER_TESTING_make_trait_auditor_url (gas->auditor_url),
TALER_TESTING_trait_end ()
};