summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_patch_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_patch_template.c')
-rw-r--r--src/testing/testing_api_cmd_patch_template.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/testing/testing_api_cmd_patch_template.c b/src/testing/testing_api_cmd_patch_template.c
index a2a75b89..8ad9d9dc 100644
--- a/src/testing/testing_api_cmd_patch_template.c
+++ b/src/testing/testing_api_cmd_patch_template.c
@@ -60,9 +60,9 @@ struct PatchTemplateState
const char *template_description;
/**
- * base64-encoded template image
+ * OTP device ID
*/
- char *image;
+ char *otp_id;
/**
* Contract of the company
@@ -85,7 +85,7 @@ struct PatchTemplateState
*/
static void
patch_template_cb (void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr)
+ const struct TALER_MERCHANT_HttpResponse *hr)
{
struct PatchTemplateState *pis = cls;
@@ -131,20 +131,21 @@ patch_template_cb (void *cls,
*/
static void
patch_template_run (void *cls,
- const struct TALER_TESTING_Command *cmd,
- struct TALER_TESTING_Interpreter *is)
+ const struct TALER_TESTING_Command *cmd,
+ struct TALER_TESTING_Interpreter *is)
{
struct PatchTemplateState *pis = cls;
pis->is = is;
- pis->iph = TALER_MERCHANT_template_patch (is->ctx,
- pis->merchant_url,
- pis->template_id,
- pis->template_description,
- pis->image,
- pis->template_contract,
- &patch_template_cb,
- pis);
+ pis->iph = TALER_MERCHANT_template_patch (
+ TALER_TESTING_interpreter_get_context (is),
+ pis->merchant_url,
+ pis->template_id,
+ pis->template_description,
+ pis->otp_id,
+ pis->template_contract,
+ &patch_template_cb,
+ pis);
GNUNET_assert (NULL != pis->iph);
}
@@ -161,17 +162,16 @@ patch_template_run (void *cls,
*/
static enum GNUNET_GenericReturnValue
patch_template_traits (void *cls,
- const void **ret,
- const char *trait,
- unsigned int index)
+ const void **ret,
+ const char *trait,
+ unsigned int index)
{
struct PatchTemplateState *pts = cls;
struct TALER_TESTING_Trait traits[] = {
- TALER_TESTING_make_trait_template_description (&pts->template_description),
- TALER_TESTING_make_trait_template_image (
- (const char **) &pts->image),
+ TALER_TESTING_make_trait_template_description (pts->template_description),
+ TALER_TESTING_make_trait_otp_id (pts->otp_id),
TALER_TESTING_make_trait_template_contract (pts->template_contract),
- TALER_TESTING_make_trait_template_id (&pts->template_id),
+ TALER_TESTING_make_trait_template_id (pts->template_id),
TALER_TESTING_trait_end (),
};
@@ -191,7 +191,7 @@ patch_template_traits (void *cls,
*/
static void
patch_template_cleanup (void *cls,
- const struct TALER_TESTING_Command *cmd)
+ const struct TALER_TESTING_Command *cmd)
{
struct PatchTemplateState *pis = cls;
@@ -201,7 +201,7 @@ patch_template_cleanup (void *cls,
"PATCH /templates/$ID operation did not complete\n");
TALER_MERCHANT_template_patch_cancel (pis->iph);
}
- GNUNET_free (pis->image);
+ GNUNET_free (pis->otp_id);
json_decref (pis->template_contract);
GNUNET_free (pis);
}
@@ -213,7 +213,7 @@ TALER_TESTING_cmd_merchant_patch_template (
const char *merchant_url,
const char *template_id,
const char *template_description,
- const char *image,
+ const char *otp_id,
json_t *template_contract,
unsigned int http_status)
{
@@ -224,7 +224,7 @@ TALER_TESTING_cmd_merchant_patch_template (
pis->template_id = template_id;
pis->http_status = http_status;
pis->template_description = template_description;
- pis->image = (NULL == image) ? NULL : GNUNET_strdup (image);
+ pis->otp_id = (NULL == otp_id) ? NULL : GNUNET_strdup (otp_id);
pis->template_contract = template_contract; /* ownership taken */
{
struct TALER_TESTING_Command cmd = {