commit 428abf88be80be73ae495e6cd79345e46cece515
parent e04cb7542503cccc000e5cc9aba4cb6f50ddaf6b
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Mon, 2 Jul 2018 22:01:57 +0200
polishing tip CMD
Diffstat:
2 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
@@ -1005,6 +1005,11 @@ struct TALER_MERCHANT_TipQueryOperation;
* @param http_status HTTP status code for this request
* @param ec Taler-specific error code
* @param raw raw response body
+ * @param reserve_expiration when the tip reserve will expire
+ * @param reserve_pub tip reserve public key
+ * @param amount_authorized total amount authorized on tip reserve
+ * @param amount_available total amount still available on tip reserve
+ * @param amount_picked_up total amount picked up from tip reserve
*/
typedef void
(*TALER_MERCHANT_TipQueryCallback) (void *cls,
diff --git a/src/lib/testing_api_cmd_tip.c b/src/lib/testing_api_cmd_tip.c
@@ -96,9 +96,7 @@ struct TipPickupState
const char **amounts;
/**
- * The object version of the above @a amounts. FIXME:
- * try to remove and run tests to see if other commands
- * need this data.
+ * The object version of the above @a amounts.
*/
struct TALER_Amount *amounts_obj;
@@ -192,7 +190,8 @@ struct TipQueryState
const char *expected_amount_authorized;
/**
- * FIXME: what is this?
+ * Amount that is expected to be still available
+ * from the tip reserve.
*/
const char *expected_amount_available;
};
@@ -557,6 +556,12 @@ TALER_TESTING_cmd_tip_authorize (const char *label,
* @param http_status HTTP status code for this request
* @param ec Taler-specific error code
* @param raw raw response body
+ * @param reserve_expiration when the tip reserve will expire
+ * @param reserve_pub tip reserve public key
+ * @param amount_authorized total amount authorized on tip reserve
+ * @param amount_available total amount still available on
+ * tip reserve
+ * @param amount_picked_up total amount picked up from tip reserve
*/
static void
tip_query_cb (void *cls,
@@ -682,7 +687,9 @@ tip_query_run (void *cls,
* picked up.
* @param expected_amount_authorized expected amount that was
* authorized in the first place.
- * @param expected_amount_available FIXME what is this?
+ * @param expected_amount_available expected amount which is
+ * still available from the tip reserve
+ * @return the command
*/
struct TALER_TESTING_Command
TALER_TESTING_cmd_tip_query_with_amounts
@@ -1056,7 +1063,13 @@ tip_pickup_cleanup (void *cls,
const struct TALER_TESTING_Command *cmd)
{
struct TipPickupState *tps = cls;
- /* FIXME: free elements *in* the state! */
+
+ GNUNET_free_non_null (tps->amounts_obj);
+ GNUNET_free_non_null (tps->dks);
+ GNUNET_free_non_null (tps->psa);
+ GNUNET_free_non_null (tps->withdraws);
+ GNUNET_free_non_null (tps->sigs);
+
if (NULL != tps->tpo)
{
TALER_LOG_WARNING ("Tip-pickup operation"