From f3d80b58f68e308a6abac304994fd040ecb91eda Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Tue, 9 Apr 2019 17:14:13 +0200 Subject: Make the API-agnostic iterator work. This allows to build local histories to be matched against the ones returned by the bank; in particular, this version builds those stories regardless of /history or /history-range being run. --- src/include/taler_testing_bank_lib.h | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'src/include/taler_testing_bank_lib.h') diff --git a/src/include/taler_testing_bank_lib.h b/src/include/taler_testing_bank_lib.h index a3cc741e6..6bd1026f7 100644 --- a/src/include/taler_testing_bank_lib.h +++ b/src/include/taler_testing_bank_lib.h @@ -109,6 +109,74 @@ TALER_TESTING_cmd_bank_history const char *start_row_reference, long long num_results); + +/** + * 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". + * @param num_results how many results we want from the bank; NOTE, + * this value is NOT used to issue any "delta" parameter in + * the HTTP request. Rather, it is only checked against + * the results returned by the bank. + * @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, + long long num_results); + + +/** + * 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". + * @param num_results how many results we want from the bank; NOTE, + * this value is NOT used to issue any "delta" parameter in + * the HTTP request. Rather, it is only checked against + * the results returned by the bank. + * + * @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, + long long num_results); + + /** * Create a "reject" CMD. * -- cgit v1.2.3