diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-01-18 16:41:24 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-01-18 16:41:24 +0100 |
commit | 644049274c36733b14832b07ed3517da01865183 (patch) | |
tree | 3f023662ac32be7afe99a6ed91b3041aea02e2a3 | |
parent | 204b545db1eca882adb2b1a3dea5c6c860f91def (diff) | |
download | exchange-644049274c36733b14832b07ed3517da01865183.tar.xz |
doxygen
-rw-r--r-- | src/exchange/taler-exchange-httpd_refresh_reveal.c | 2 | ||||
-rw-r--r-- | src/include/taler_auditor_service.h | 4 | ||||
-rw-r--r-- | src/include/taler_fakebank_lib.h | 3 | ||||
-rw-r--r-- | src/include/taler_testing_lib.h | 10 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_auditor_exchanges.c | 1 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_check_keys.c | 123 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_refresh.c | 1 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_wire.c | 21 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_withdraw.c | 40 | ||||
-rw-r--r-- | src/lib/testing_api_helpers_bank.c | 12 | ||||
-rw-r--r-- | src/lib/testing_api_loop.c | 37 |
11 files changed, 114 insertions, 140 deletions
diff --git a/src/exchange/taler-exchange-httpd_refresh_reveal.c b/src/exchange/taler-exchange-httpd_refresh_reveal.c index 9b13c2376..56e29adfb 100644 --- a/src/exchange/taler-exchange-httpd_refresh_reveal.c +++ b/src/exchange/taler-exchange-httpd_refresh_reveal.c @@ -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. * diff --git a/src/include/taler_auditor_service.h b/src/include/taler_auditor_service.h index 486e7cc4b..4849c2fe1 100644 --- a/src/include/taler_auditor_service.h +++ b/src/include/taler_auditor_service.h @@ -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 diff --git a/src/include/taler_fakebank_lib.h b/src/include/taler_fakebank_lib.h index 1fe83c480..278d0a00d 100644 --- a/src/include/taler_fakebank_lib.h +++ b/src/include/taler_fakebank_lib.h @@ -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 diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index dccb1c2b2..c1c2becc3 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -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 diff --git a/src/lib/testing_api_cmd_auditor_exchanges.c b/src/lib/testing_api_cmd_auditor_exchanges.c index 3b2187a3d..b51a9276b 100644 --- a/src/lib/testing_api_cmd_auditor_exchanges.c +++ b/src/lib/testing_api_cmd_auditor_exchanges.c @@ -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. diff --git a/src/lib/testing_api_cmd_check_keys.c b/src/lib/testing_api_cmd_check_keys.c index c67377d92..3488af7ad 100644 --- a/src/lib/testing_api_cmd_check_keys.c +++ b/src/lib/testing_api_cmd_check_keys.c @@ -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 - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .cls = cks, + .label = label, + .run = &check_keys_run, + .cleanup = &check_keys_cleanup + }; + + 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 - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .cls = cks, + .label = label, + .run = &check_keys_run, + .cleanup = &check_keys_cleanup + }; + + 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 - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .cls = cks, + .label = label, + .run = &check_keys_run, + .cleanup = &check_keys_cleanup + }; + + 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 - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .cls = cks, + .label = label, + .run = &check_keys_run, + .cleanup = &check_keys_cleanup + }; + + return cmd; + } } diff --git a/src/lib/testing_api_cmd_refresh.c b/src/lib/testing_api_cmd_refresh.c index fb3ee185d..44911a6df 100644 --- a/src/lib/testing_api_cmd_refresh.c +++ b/src/lib/testing_api_cmd_refresh.c @@ -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. diff --git a/src/lib/testing_api_cmd_wire.c b/src/lib/testing_api_cmd_wire.c index 991a6ceb8..e8bf176a6 100644 --- a/src/lib/testing_api_cmd_wire.c +++ b/src/lib/testing_api_cmd_wire.c @@ -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 - }; - - return cmd; + { + struct TALER_TESTING_Command cmd = { + .cls = ws, + .label = label, + .run = &wire_run, + .cleanup = &wire_cleanup + }; + + return cmd; + } } diff --git a/src/lib/testing_api_cmd_withdraw.c b/src/lib/testing_api_cmd_withdraw.c index d3779e20e..460a55d4e 100644 --- a/src/lib/testing_api_cmd_withdraw.c +++ b/src/lib/testing_api_cmd_withdraw.c @@ -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; diff --git a/src/lib/testing_api_helpers_bank.c b/src/lib/testing_api_helpers_bank.c index 7ff8d976e..0e4510ec7 100644 --- a/src/lib/testing_api_helpers_bank.c +++ b/src/lib/testing_api_helpers_bank.c @@ -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. */ diff --git a/src/lib/testing_api_loop.c b/src/lib/testing_api_loop.c index dd1adea92..06151d02c 100644 --- a/src/lib/testing_api_loop.c +++ b/src/lib/testing_api_loop.c @@ -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; |