Command "withdraw" CMD.

This commit is contained in:
Marcello Stanisci 2018-05-26 10:24:33 +02:00
parent a249d583f0
commit cdd4294a37
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F

View File

@ -30,6 +30,10 @@
#include "taler_testing_lib.h" #include "taler_testing_lib.h"
/**
* State for a "withdraw" CMD.
*/
struct WithdrawState struct WithdrawState
{ {
@ -92,17 +96,15 @@ struct WithdrawState
/** /**
* Function called upon completion of our /reserve/withdraw * "reserve withdraw" operation callback; checks that the
* request. * response code is expected and store the exchange signature
* in the state.
* *
* @param cls closure with the withdraw state * @param cls closure.
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for * @param http_status HTTP response code.
* successful status request; 0 if the exchange's reply is * @param ec taler-specific error code.
* bogus (fails to follow the protocol) * @param sig signature over the coin, NULL on error.
* @param ec taler-specific error code, #TALER_EC_NONE on success * @param full_response raw response.
* @param sig signature over the coin, NULL on error
* @param full_response full response from the exchange (for
* logging, in case of errors)
*/ */
static void static void
reserve_withdraw_cb (void *cls, reserve_withdraw_cb (void *cls,
@ -156,14 +158,11 @@ reserve_withdraw_cb (void *cls,
/** /**
* Runs the command. Note that upon return, the interpreter * Run the command.
* will not automatically run the next command, as the command
* may continue asynchronously in other scheduler tasks. Thus,
* the command must ensure to eventually call
* #TALER_TESTING_interpreter_next() or
* #TALER_TESTING_interpreter_fail().
* *
* @param is interpreter state * @param cls closure.
* @param cmd the commaind being run.
* @param is interpreter state.
*/ */
static void static void
withdraw_run (void *cls, withdraw_run (void *cls,
@ -210,10 +209,11 @@ withdraw_run (void *cls,
/** /**
* Clean up after the command. Run during forced termination * Free the state of a "withdraw" CMD, and possibly cancel
* (CTRL-C) or test failure or test success. * a pending operation thereof.
* *
* @param cls closure * @param cls closure.
* @param cmd the command being freed.
*/ */
static void static void
withdraw_cleanup (void *cls, withdraw_cleanup (void *cls,
@ -240,7 +240,7 @@ withdraw_cleanup (void *cls,
/** /**
* Extract information from a command that is useful for other * Offer internal data to a "withdraw" CMD state to other
* commands. * commands.
* *
* @param cls closure * @param cls closure
@ -249,6 +249,7 @@ withdraw_cleanup (void *cls,
* @param selector more detailed information about which object * @param selector more detailed information about which object
* to return in case there were multiple generated * to return in case there were multiple generated
* by the command * by the command
*
* @return #GNUNET_OK on success * @return #GNUNET_OK on success
*/ */
static int static int
@ -307,10 +308,10 @@ withdraw_traits (void *cls,
/** /**
* Create a withdraw command. * Create a withdraw command, letting the caller specify
* the desired amount as string.
* *
* @param label command label, used by other commands to * @param label command label.
* reference this.
* @param exchange handle to the exchange. * @param exchange handle to the exchange.
* @param amount how much we withdraw. * @param amount how much we withdraw.
* @param expected_response_code which HTTP response code * @param expected_response_code which HTTP response code
@ -366,8 +367,17 @@ TALER_TESTING_cmd_withdraw_amount
/** /**
* Create withdraw command. * Create withdraw command, letting the caller specify the
* amount by a denomination key.
* *
* @param label command label.
* @param exchange connection handle to the exchange.
* @param reserve_reference reference to the reserve to withdraw
* from; will provide reserve priv to sign the request.
* @param dk denomination public key.
* @param expected_response_code expected HTTP response code.
*
* @return the command.
*/ */
struct TALER_TESTING_Command struct TALER_TESTING_Command
TALER_TESTING_cmd_withdraw_denomination TALER_TESTING_cmd_withdraw_denomination
@ -402,5 +412,4 @@ TALER_TESTING_cmd_withdraw_denomination
return cmd; return cmd;
} }
/* end of testing_api_cmd_withdraw.c */ /* end of testing_api_cmd_withdraw.c */