diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-12-15 18:16:33 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-12-15 18:16:33 +0100 |
commit | 36e15a501fc8285f75a0e403d4d64e46f77c732d (patch) | |
tree | 2d5d81b3bff1c9cbe1cad4aaa24e61932eda169b /src/bank-lib/testing_api_cmd_history.c | |
parent | 745a48ef7c01170c2b37bfe7849f9704f8ecc274 (diff) |
purge history-range API, no longer needed (#5993)
Diffstat (limited to 'src/bank-lib/testing_api_cmd_history.c')
-rw-r--r-- | src/bank-lib/testing_api_cmd_history.c | 188 |
1 files changed, 1 insertions, 187 deletions
diff --git a/src/bank-lib/testing_api_cmd_history.c b/src/bank-lib/testing_api_cmd_history.c index 0b5184ad8..dc5cd2d99 100644 --- a/src/bank-lib/testing_api_cmd_history.c +++ b/src/bank-lib/testing_api_cmd_history.c @@ -61,9 +61,7 @@ struct HistoryState const char *start_row_reference; /** - * How many rows we want in the result, _at most_. In - * the case of /history-range, we fake this value with - * UINT64_MAX. + * How many rows we want in the result, _at most_. */ unsigned long long num_results; @@ -930,85 +928,6 @@ history_run (void *cls, /** - * Run the command. - * - * @param cls closure. - * @param cmd the command to execute. - * @param is the interpreter state. - */ -static void -history_range_run (void *cls, - const struct TALER_TESTING_Command *cmd, - struct TALER_TESTING_Interpreter *is) -{ - struct HistoryState *hs = cls; - const struct GNUNET_TIME_Absolute *start_date; - const struct GNUNET_TIME_Absolute *end_date; - struct TALER_BANK_AuthenticationData *auth; - - (void) cmd; - if (NULL != hs->start_row_reference) - { - const struct TALER_TESTING_Command *history_cmd; - - history_cmd = TALER_TESTING_interpreter_lookup_command - (is, hs->start_row_reference); - - if (NULL == history_cmd) - TALER_TESTING_FAIL (is); - - if (GNUNET_OK != TALER_TESTING_get_trait_absolute_time - (history_cmd, 0, &start_date)) - TALER_TESTING_FAIL (is); - hs->start_date = *start_date; - } - else - { - /* no trait wanted. */ - GNUNET_assert (GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us != - hs->start_date.abs_value_us); - start_date = &hs->start_date; - } - - if (NULL != hs->end_row_reference) - { - const struct TALER_TESTING_Command *history_cmd; - - history_cmd = TALER_TESTING_interpreter_lookup_command - (is, hs->end_row_reference); - - if (NULL == history_cmd) - TALER_TESTING_FAIL (is); - - if (GNUNET_OK != TALER_TESTING_get_trait_absolute_time - (history_cmd, 0, &end_date)) - TALER_TESTING_FAIL (is); - hs->end_date = *end_date; - } - else - { - /* no trait wanted. */ - GNUNET_assert (GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us != - hs->end_date.abs_value_us); - end_date = &hs->end_date; - } - - auth = &AUTHS[hs->account_no - 1]; - hs->hh = TALER_BANK_history_range (is->ctx, - hs->bank_url, - auth, - hs->account_no, - hs->direction, - hs->ascending, - *start_date, - *end_date, - &history_cb, - is); - GNUNET_assert (NULL != hs->hh); -} - - -/** * Free the state from a "history" CMD, and possibly cancel * a pending operation thereof. * @@ -1082,109 +1001,4 @@ TALER_TESTING_cmd_bank_history (const char *label, } -/** - * Make a "history-range" CMD, picking dates from traits. - * - * @param label command label. - * @param bank_url base URL of the bank offering the "history" - * operation. - * @param account_no bank account number to ask the history for. - * @param direction which direction this operation is interested. - * @param ascending if GNUNET_YES, the bank will return the rows - * in ascending (= chronological) order. - * @param start_row_reference reference to a command that can - * offer a absolute time to use as the 'start' argument - * for "/history-range". - * @param end_row_reference reference to a command that can - * offer a absolute time to use as the 'end' argument - * for "/history-range". - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_bank_history_range - (const char *label, - const char *bank_url, - uint64_t account_no, - enum TALER_BANK_Direction direction, - unsigned int ascending, - const char *start_row_reference, - const char *end_row_reference) -{ - struct HistoryState *hs; - - hs = GNUNET_new (struct HistoryState); - hs->bank_url = bank_url; - hs->account_no = account_no; - hs->direction = direction; - hs->start_row_reference = start_row_reference; - hs->end_row_reference = end_row_reference; - hs->ascending = ascending; - hs->start_date = GNUNET_TIME_UNIT_FOREVER_ABS; - hs->end_date = GNUNET_TIME_UNIT_FOREVER_ABS; - - { - struct TALER_TESTING_Command cmd = { - .label = label, - .cls = hs, - .run = &history_range_run, - .cleanup = &history_cleanup, - .traits = &history_traits - }; - - return cmd; - } -} - - -/** - * Make a "history-range" CMD, picking dates from the arguments. - * - * @param label command label. - * @param bank_url base URL of the bank offering the "history" - * operation. - * @param account_no bank account number to ask the history for. - * @param direction which direction this operation is interested. - * @param ascending if GNUNET_YES, the bank will return the rows - * in ascending (= chronological) order. - * @param start_date value for the 'start' argument - * of "/history-range". - * @param end_date value for the 'end' argument - * of "/history-range". - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_bank_history_range_with_dates - (const char *label, - const char *bank_url, - uint64_t account_no, - enum TALER_BANK_Direction direction, - unsigned int ascending, - struct GNUNET_TIME_Absolute start_date, - struct GNUNET_TIME_Absolute end_date) -{ - struct HistoryState *hs; - - hs = GNUNET_new (struct HistoryState); - hs->bank_url = bank_url; - hs->account_no = account_no; - hs->direction = direction; - hs->ascending = ascending; - hs->start_row_reference = NULL; - hs->start_date = start_date; - hs->end_date = end_date; - - { - struct TALER_TESTING_Command cmd = { - .label = label, - .cls = hs, - .run = &history_range_run, - .cleanup = &history_cleanup, - .traits = &history_traits - }; - - return cmd; - } -} - - /* end of testing_api_cmd_history.c */ |