summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_patch_instance.c
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-06-22 03:20:54 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-06-22 03:20:54 -0400
commitda6a10eed07b409718eaf069d0d413a4aac82c0a (patch)
tree297cf795ad364baa7f5d200929a2c7cab18fe23e /src/testing/testing_api_cmd_patch_instance.c
parentd4f400ec85410671cf0890d0f7388d9c91a4e414 (diff)
downloadmerchant-da6a10eed07b409718eaf069d0d413a4aac82c0a.tar.gz
merchant-da6a10eed07b409718eaf069d0d413a4aac82c0a.tar.bz2
merchant-da6a10eed07b409718eaf069d0d413a4aac82c0a.zip
deeper checks for GET /private/instances/
Diffstat (limited to 'src/testing/testing_api_cmd_patch_instance.c')
-rw-r--r--src/testing/testing_api_cmd_patch_instance.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/testing/testing_api_cmd_patch_instance.c b/src/testing/testing_api_cmd_patch_instance.c
index 81190769..cb547ff4 100644
--- a/src/testing/testing_api_cmd_patch_instance.c
+++ b/src/testing/testing_api_cmd_patch_instance.c
@@ -183,6 +183,43 @@ patch_instance_run (void *cls,
/**
+ * Offers information from the PATCH /instances CMD state to other
+ * commands.
+ *
+ * @param cls closure
+ * @param ret[out] result (could be anything)
+ * @param trait name of the trait
+ * @param index index number of the object to extract.
+ * @return #GNUNET_OK on success
+ */
+static int
+patch_instance_traits (void *cls,
+ const void **ret,
+ const char *trait,
+ unsigned int index)
+{
+ struct PatchInstanceState *pis = cls;
+ struct TALER_TESTING_Trait traits[] = {
+ TALER_TESTING_make_trait_string (0, pis->name),
+ TALER_TESTING_make_trait_merchant_address (0, pis->address),
+ TALER_TESTING_make_trait_merchant_jurisdiction (0, pis->jurisdiction),
+ TALER_TESTING_make_trait_amount_obj (0, &pis->default_max_wire_fee),
+ TALER_TESTING_make_trait_uint32 (0, &pis->default_wire_fee_amortization),
+ TALER_TESTING_make_trait_amount_obj (1, &pis->default_max_deposit_fee),
+ TALER_TESTING_make_trait_relative_time (0,
+ &pis->default_wire_transfer_delay),
+ TALER_TESTING_make_trait_relative_time (1, &pis->default_pay_delay),
+ TALER_TESTING_trait_end (),
+ };
+
+ return TALER_TESTING_get_trait (traits,
+ ret,
+ trait,
+ index);
+}
+
+
+/**
* Free the state of a "PATCH /instances/$ID" CMD, and possibly
* cancel a pending operation thereof.
*
@@ -274,7 +311,8 @@ TALER_TESTING_cmd_merchant_patch_instance (
.cls = pis,
.label = label,
.run = &patch_instance_run,
- .cleanup = &patch_instance_cleanup
+ .cleanup = &patch_instance_cleanup,
+ .traits = &patch_instance_traits
};
return cmd;