summaryrefslogtreecommitdiff
path: root/src/bank-lib/testing_api_cmd_history.c
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-12-14 00:34:35 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2018-12-14 19:25:42 +0100
commit15c1a877c617fd29ff61e2ebd1f6fac72e54afce (patch)
tree2781d327ca51bce8c172f0907bb93c86cc13d579 /src/bank-lib/testing_api_cmd_history.c
parentc2b6a1065474df88df8d501d7a83b67032bd121d (diff)
downloadexchange-15c1a877c617fd29ff61e2ebd1f6fac72e54afce.tar.gz
exchange-15c1a877c617fd29ff61e2ebd1f6fac72e54afce.tar.bz2
exchange-15c1a877c617fd29ff61e2ebd1f6fac72e54afce.zip
/history API semantics extended.
That API has now a new 'ordering' flag that lets the client choose what ordering the results should have: ascending or descending. In particular, this change adapted the fakebank and tests logic to such introduction.
Diffstat (limited to 'src/bank-lib/testing_api_cmd_history.c')
-rw-r--r--src/bank-lib/testing_api_cmd_history.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/bank-lib/testing_api_cmd_history.c b/src/bank-lib/testing_api_cmd_history.c
index 7b831d4e..c60f6a13 100644
--- a/src/bank-lib/testing_api_cmd_history.c
+++ b/src/bank-lib/testing_api_cmd_history.c
@@ -84,6 +84,12 @@ struct HistoryState
* unexpected.
*/
int failed;
+
+ /**
+ * If GNUNET_YES, this parameter will ask for results in
+ * chronological order.
+ */
+ unsigned int ascending;
};
/**
@@ -726,6 +732,7 @@ history_run (void *cls,
auth,
hs->account_no,
hs->direction,
+ hs->ascending,
row_id,
hs->num_results,
&history_cb,
@@ -765,8 +772,9 @@ history_cleanup
* @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
- * in.
+ * @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 row identifier, to be used as the starting row
* to accept in the result.
@@ -780,6 +788,7 @@ TALER_TESTING_cmd_bank_history
const char *bank_url,
uint64_t account_no,
enum TALER_BANK_Direction direction,
+ unsigned int ascending,
const char *start_row_reference,
long long num_results)
{
@@ -792,6 +801,7 @@ TALER_TESTING_cmd_bank_history
hs->direction = direction;
hs->start_row_reference = start_row_reference;
hs->num_results = num_results;
+ hs->ascending = ascending;
cmd.label = label;
cmd.cls = hs;