This commit is contained in:
Christian Grothoff 2020-01-18 16:41:24 +01:00
parent 204b545db1
commit 644049274c
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
11 changed files with 109 additions and 135 deletions

View File

@ -787,7 +787,7 @@ cleanup:
/**
* Handle a "/refresh/reveal" request. Parses the given JSON
* transfer private keys and if successful, passes everything to
* #TEH_DB_execute_refresh_reveal() which will verify that the
* #resolve_refresh_reveal_denominations() which will verify that the
* revealed information is valid then returns the signed refreshed
* coins.
*

View File

@ -206,7 +206,7 @@ typedef void
* @param master_pub master public key of the exchange
* @param ep_start when does @a exchange_pub validity start
* @param ep_expire when does @a exchange_pub usage end
* @param ep_legal_end when does @a exchange_pub legal validity end
* @param ep_end when does @a exchange_pub legal validity end
* @param master_sig master signature affirming validity of @a exchange_pub
* @param cb the callback to call when a reply for this request is available
* @param cb_cls closure for the above callback
@ -234,7 +234,7 @@ TALER_AUDITOR_deposit_confirmation (struct TALER_AUDITOR_Handle *auditor,
TALER_MasterPublicKeyP *master_pub,
struct GNUNET_TIME_Absolute ep_start,
struct GNUNET_TIME_Absolute ep_expire,
struct GNUNET_TIME_Absolute ep_legal_end,
struct GNUNET_TIME_Absolute ep_end,
const struct
TALER_MasterSignatureP *master_sig,
TALER_AUDITOR_DepositConfirmationResultCallback

View File

@ -52,7 +52,8 @@ TALER_FAKEBANK_start (uint16_t port);
/**
* Check that no wire transfers were ordered (or at least none
* that have not been taken care of via #TALER_FAKEBANK_check()).
* that have not been taken care of via #TALER_FAKEBANK_check_debit()
* or #TALER_FAKEBANK_check_credit()).
* If any transactions are onrecord, return #GNUNET_SYSERR.
*
* @param h bank instance

View File

@ -976,7 +976,6 @@ TALER_TESTING_cmd_exchanges (const char *label,
* a particular exchange belongs to the returned bundle.
*
* @param label command label.
* @param auditor auditor connection.
* @param expected_response_code expected HTTP response code.
* @param exchange_url URL of the exchange supposed to
* be included in the response.
@ -1153,8 +1152,7 @@ TALER_TESTING_cmd_exec_keyup_with_now (const char *label,
* first make sure that @a generation downloads are done,
* and _then_ execute the rest of the command.
* @param num_denom_keys expected number of denomination keys.
* @param exchange connection handle to the exchange to test.
*
* @param now timestamp to use when fetching keys
* @return the command.
*/
struct TALER_TESTING_Command
@ -1354,10 +1352,8 @@ TALER_TESTING_cmd_refresh_melt_with_retry (struct TALER_TESTING_Command cmd);
* Create a "refresh reveal" command.
*
* @param label command label.
* @param exchange connection to the exchange.
* @param melt_reference reference to a "refresh melt" command.
* @param expected_response_code expected HTTP response code.
*
* @return the command.
*/
struct TALER_TESTING_Command
@ -1686,8 +1682,6 @@ TALER_TESTING_cmd_check_keys (const char *label,
* first make sure that @a generation downloads are done,
* and _then_ execute the rest of the command.
* @param num_denom_keys expected number of denomination keys.
* @param exchange connection handle to the exchange to test.
*
* @return the command.
*/
struct TALER_TESTING_Command
@ -1710,10 +1704,8 @@ TALER_TESTING_cmd_check_keys_pull_all_keys (const char *label,
* first make sure that @a generation downloads are done,
* and _then_ execute the rest of the command.
* @param num_denom_keys expected number of denomination keys.
* @param exchange connection handle to the exchange to test.
* @param last_denom_date date to be set in the "last_denom_issue"
* URL parameter of /keys.
*
* @return the command.
*/
struct TALER_TESTING_Command

View File

@ -308,7 +308,6 @@ TALER_TESTING_cmd_exchanges (const char *label,
* a particular exchange belongs to the returned bundle.
*
* @param label command label.
* @param auditor auditor connection.
* @param expected_response_code expected HTTP response code.
* @param exchange_url URL of the exchange supposed to
* be included in the response.

View File

@ -16,7 +16,6 @@
License along with TALER; see the file COPYING. If not, see
<http://www.gnu.org/licenses/>
*/
/**
* @file lib/testing_api_cmd_check_keys.c
* @brief Implementation of "check keys" test command. XXX-NOTE:
@ -29,7 +28,6 @@
*
* @author Marcello Stanisci
*/
#include "platform.h"
#include "taler_json_lib.h"
#include <gnunet/gnunet_curl_lib.h>
@ -142,7 +140,8 @@ check_keys_run (void *cls,
* a "maybe" basis, so it can get quite hard to track /keys
* request. Rather, this CMD should just check if /keys was
* requested AT LEAST n times before going ahead with checks.
*/if (is->key_generation > cks->generation)
*///
if (is->key_generation > cks->generation)
{
/* We got /keys too often, strange. Fatal. May theoretically
happen if somehow we were really unlucky and /keys expired
@ -207,18 +206,16 @@ check_keys_cleanup (void *cls,
* first make sure that @a generation downloads are done,
* and _then_ execute the rest of the command.
* @param num_denom_keys expected number of denomination keys.
* @param exchange connection handle to the exchange to test.
* @param last_denom_date date to be set in the "last_denom_issue"
* URL parameter of /keys.
*
* @return the command.
*/
struct TALER_TESTING_Command
TALER_TESTING_cmd_check_keys_with_last_denom
(const char *label,
unsigned int generation,
unsigned int num_denom_keys,
struct GNUNET_TIME_Absolute last_denom_date)
TALER_TESTING_cmd_check_keys_with_last_denom (const char *label,
unsigned int generation,
unsigned int num_denom_keys,
struct GNUNET_TIME_Absolute
last_denom_date)
{
struct CheckKeysState *cks;
@ -227,15 +224,16 @@ TALER_TESTING_cmd_check_keys_with_last_denom
cks->num_denom_keys = num_denom_keys;
cks->set_last_denom = GNUNET_YES;
cks->last_denom_date = last_denom_date;
{
struct TALER_TESTING_Command cmd = {
.cls = cks,
.label = label,
.run = &check_keys_run,
.cleanup = &check_keys_cleanup
};
struct TALER_TESTING_Command cmd = {
.cls = cks,
.label = label,
.run = &check_keys_run,
.cleanup = &check_keys_cleanup
};
return cmd;
return cmd;
}
}
@ -251,30 +249,28 @@ TALER_TESTING_cmd_check_keys_with_last_denom
* first make sure that @a generation downloads are done,
* and _then_ execute the rest of the command.
* @param num_denom_keys expected number of denomination keys.
* @param exchange connection handle to the exchange to test.
*
* @return the command.
*/
struct TALER_TESTING_Command
TALER_TESTING_cmd_check_keys
(const char *label,
unsigned int generation,
unsigned int num_denom_keys)
TALER_TESTING_cmd_check_keys (const char *label,
unsigned int generation,
unsigned int num_denom_keys)
{
struct CheckKeysState *cks;
cks = GNUNET_new (struct CheckKeysState);
cks->generation = generation;
cks->num_denom_keys = num_denom_keys;
{
struct TALER_TESTING_Command cmd = {
.cls = cks,
.label = label,
.run = &check_keys_run,
.cleanup = &check_keys_cleanup
};
struct TALER_TESTING_Command cmd = {
.cls = cks,
.label = label,
.run = &check_keys_run,
.cleanup = &check_keys_cleanup
};
return cmd;
return cmd;
}
}
@ -290,16 +286,14 @@ TALER_TESTING_cmd_check_keys
* first make sure that @a generation downloads are done,
* and _then_ execute the rest of the command.
* @param num_denom_keys expected number of denomination keys.
* @param exchange connection handle to the exchange to test.
*
* @param now timestamp to use when fetching keys
* @return the command.
*/
struct TALER_TESTING_Command
TALER_TESTING_cmd_check_keys_with_now
(const char *label,
unsigned int generation,
unsigned int num_denom_keys,
struct GNUNET_TIME_Absolute now)
TALER_TESTING_cmd_check_keys_with_now (const char *label,
unsigned int generation,
unsigned int num_denom_keys,
struct GNUNET_TIME_Absolute now)
{
struct CheckKeysState *cks;
@ -311,15 +305,16 @@ TALER_TESTING_cmd_check_keys_with_now
/* Force to NOT cherry pick, otherwise they conflict. */
cks->pull_all_keys = GNUNET_YES;
{
struct TALER_TESTING_Command cmd = {
.cls = cks,
.label = label,
.run = &check_keys_run,
.cleanup = &check_keys_cleanup
};
struct TALER_TESTING_Command cmd = {
.cls = cks,
.label = label,
.run = &check_keys_run,
.cleanup = &check_keys_cleanup
};
return cmd;
return cmd;
}
}
@ -335,15 +330,12 @@ TALER_TESTING_cmd_check_keys_with_now
* first make sure that @a generation downloads are done,
* and _then_ execute the rest of the command.
* @param num_denom_keys expected number of denomination keys.
* @param exchange connection handle to the exchange to test.
*
* @return the command.
*/
struct TALER_TESTING_Command
TALER_TESTING_cmd_check_keys_pull_all_keys
(const char *label,
unsigned int generation,
unsigned int num_denom_keys)
TALER_TESTING_cmd_check_keys_pull_all_keys (const char *label,
unsigned int generation,
unsigned int num_denom_keys)
{
struct CheckKeysState *cks;
@ -351,15 +343,16 @@ TALER_TESTING_cmd_check_keys_pull_all_keys
cks->generation = generation;
cks->num_denom_keys = num_denom_keys;
cks->pull_all_keys = GNUNET_YES;
{
struct TALER_TESTING_Command cmd = {
.cls = cks,
.label = label,
.run = &check_keys_run,
.cleanup = &check_keys_cleanup
};
struct TALER_TESTING_Command cmd = {
.cls = cks,
.label = label,
.run = &check_keys_run,
.cleanup = &check_keys_cleanup
};
return cmd;
return cmd;
}
}

View File

@ -1311,7 +1311,6 @@ refresh_reveal_traits (void *cls,
* Create a "refresh reveal" command.
*
* @param label command label.
* @param exchange connection to the exchange.
* @param melt_reference reference to a "refresh melt" command.
* @param expected_response_code expected HTTP response code.
* @return the command.

View File

@ -203,13 +203,11 @@ wire_cleanup (void *cls,
* Create a "wire" command.
*
* @param label the command label.
* @param exchange the exchange to connect to.
* @param expected_method which wire-transfer method is expected
* to be offered by the exchange.
* @param expected_fee the fee the exchange should charge.
* @param expected_response_code the HTTP response the exchange
* should return.
*
* @return the command.
*/
struct TALER_TESTING_Command
@ -224,13 +222,14 @@ TALER_TESTING_cmd_wire (const char *label,
ws->expected_method = expected_method;
ws->expected_fee = expected_fee;
ws->expected_response_code = expected_response_code;
{
struct TALER_TESTING_Command cmd = {
.cls = ws,
.label = label,
.run = &wire_run,
.cleanup = &wire_cleanup
};
struct TALER_TESTING_Command cmd = {
.cls = ws,
.label = label,
.run = &wire_run,
.cleanup = &wire_cleanup
};
return cmd;
return cmd;
}
}

View File

@ -336,7 +336,6 @@ withdraw_cleanup (void *cls,
TALER_EXCHANGE_destroy_denomination_key (ws->pk);
ws->pk = NULL;
}
GNUNET_free_non_null (ws->exchange_url);
GNUNET_free (ws);
}
@ -438,11 +437,10 @@ withdraw_traits (void *cls,
* @return the withdraw command to be executed by the interpreter.
*/
struct TALER_TESTING_Command
TALER_TESTING_cmd_withdraw_amount
(const char *label,
const char *reserve_reference,
const char *amount,
unsigned int expected_response_code)
TALER_TESTING_cmd_withdraw_amount (const char *label,
const char *reserve_reference,
const char *amount,
unsigned int expected_response_code)
{
struct WithdrawState *ws;
@ -461,16 +459,17 @@ TALER_TESTING_cmd_withdraw_amount
}
ws->expected_response_code = expected_response_code;
{
struct TALER_TESTING_Command cmd = {
.cls = ws,
.label = label,
.run = &withdraw_run,
.cleanup = &withdraw_cleanup,
.traits = &withdraw_traits
};
struct TALER_TESTING_Command cmd = {
.cls = ws,
.label = label,
.run = &withdraw_run,
.cleanup = &withdraw_cleanup,
.traits = &withdraw_traits
};
return cmd;
return cmd;
}
}
@ -479,7 +478,6 @@ TALER_TESTING_cmd_withdraw_amount
* 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.
@ -488,11 +486,11 @@ TALER_TESTING_cmd_withdraw_amount
* @return the command.
*/
struct TALER_TESTING_Command
TALER_TESTING_cmd_withdraw_denomination
(const char *label,
const char *reserve_reference,
const struct TALER_EXCHANGE_DenomPublicKey *dk,
unsigned int expected_response_code)
TALER_TESTING_cmd_withdraw_denomination (const char *label,
const char *reserve_reference,
const struct
TALER_EXCHANGE_DenomPublicKey *dk,
unsigned int expected_response_code)
{
struct WithdrawState *ws;

View File

@ -71,28 +71,29 @@ TALER_TESTING_run_fakebank (const char *bank_url)
*
* @param prog program's name to look into
* @param marker chunk to find in @a prog
* @return #GNUNET_YES if @a marker is present, otherwise #GNUNET_NO
*/
int
TALER_TESTING_has_in_name (const char *prog_name,
TALER_TESTING_has_in_name (const char *prog,
const char *marker)
{
size_t name_pos;
size_t pos;
if (! prog_name || ! marker)
if (! prog || ! marker)
return GNUNET_NO;
pos = 0;
name_pos = 0;
while (prog_name[pos])
while (prog[pos])
{
if ('/' == prog_name[pos])
if ('/' == prog[pos])
name_pos = pos + 1;
pos++;
}
if (name_pos == pos)
return GNUNET_YES;
return strstr (prog_name + name_pos, marker) != NULL;
return (NULL != strstr (prog + name_pos, marker));
}
@ -104,7 +105,6 @@ TALER_TESTING_has_in_name (const char *prog_name,
* @param config_filename configuration filename.
* @param bank_url base URL of the bank, used by `wget' to check
* that the bank was started right.
*
* @return the process, or NULL if the process could not
* be started.
*/

View File

@ -45,9 +45,8 @@ static struct GNUNET_DISK_PipeHandle *sigpipe;
* @return NULL if command was not found
*/
const struct TALER_TESTING_Command *
TALER_TESTING_interpreter_lookup_command
(struct TALER_TESTING_Interpreter *is,
const char *label)
TALER_TESTING_interpreter_lookup_command (struct TALER_TESTING_Interpreter *is,
const char *label)
{
if (NULL == label)
{
@ -106,8 +105,7 @@ TALER_TESTING_interpreter_get_context
struct TALER_FAKEBANK_Handle *
TALER_TESTING_interpreter_get_fakebank
(struct TALER_TESTING_Interpreter *is)
TALER_TESTING_interpreter_get_fakebank (struct TALER_TESTING_Interpreter *is)
{
return is->fakebank;
}
@ -123,10 +121,9 @@ TALER_TESTING_interpreter_get_fakebank
* @param bank_url the url the fakebank is supposed to run on
*/
void
TALER_TESTING_run_with_fakebank
(struct TALER_TESTING_Interpreter *is,
struct TALER_TESTING_Command *commands,
const char *bank_url)
TALER_TESTING_run_with_fakebank (struct TALER_TESTING_Interpreter *is,
struct TALER_TESTING_Command *commands,
const char *bank_url)
{
const char *port;
long pnum;
@ -200,8 +197,7 @@ TALER_TESTING_interpreter_next (struct TALER_TESTING_Interpreter *is)
* @param is interpreter of the test
*/
void
TALER_TESTING_interpreter_fail
(struct TALER_TESTING_Interpreter *is)
TALER_TESTING_interpreter_fail (struct TALER_TESTING_Interpreter *is)
{
struct TALER_TESTING_Command *cmd = &is->commands[is->ip];
@ -239,8 +235,8 @@ TALER_TESTING_cmd_end (void)
* Obtain current label.
*/
const char *
TALER_TESTING_interpreter_get_current_label
(struct TALER_TESTING_Interpreter *is)
TALER_TESTING_interpreter_get_current_label (struct
TALER_TESTING_Interpreter *is)
{
struct TALER_TESTING_Command *cmd = &is->commands[is->ip];
@ -452,8 +448,7 @@ maint_child_death (void *cls)
* with the next command.
*/
void
TALER_TESTING_wait_for_sigchld
(struct TALER_TESTING_Interpreter *is)
TALER_TESTING_wait_for_sigchld (struct TALER_TESTING_Interpreter *is)
{
const struct GNUNET_DISK_FileHandle *pr;
@ -592,10 +587,9 @@ sighandler_child_death ()
* @param compat protocol compatibility information.
*/
void
TALER_TESTING_cert_cb
(void *cls,
const struct TALER_EXCHANGE_Keys *keys,
enum TALER_EXCHANGE_VersionCompatibility compat)
TALER_TESTING_cert_cb (void *cls,
const struct TALER_EXCHANGE_Keys *keys,
enum TALER_EXCHANGE_VersionCompatibility compat)
{
struct MainContext *main_ctx = cls;
struct TALER_TESTING_Interpreter *is = main_ctx->is;
@ -706,9 +700,8 @@ do_abort (void *cls)
* @param cfg configuration to use
*/
static int
main_exchange_connect_with_cfg
(void *cls,
const struct GNUNET_CONFIGURATION_Handle *cfg)
main_exchange_connect_with_cfg (void *cls,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct MainContext *main_ctx = cls;
struct TALER_TESTING_Interpreter *is = main_ctx->is;