diff options
Diffstat (limited to 'src/testing/testing_api_cmd_patch_instance.c')
-rw-r--r-- | src/testing/testing_api_cmd_patch_instance.c | 40 |
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; |