[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: 'start' and 'nrows'
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: 'start' and 'nrows' not hardcoded anymore in testcase. |
Date: |
Mon, 20 Mar 2017 16:26:33 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new b6f8454 'start' and 'nrows' not hardcoded anymore in testcase.
b6f8454 is described below
commit b6f8454085041d96777ad9bf4cbb61b8a040b42d
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Mar 20 16:26:15 2017 +0100
'start' and 'nrows' not hardcoded anymore in testcase.
---
src/backenddb/plugin_merchantdb_postgres.c | 6 ++++++
src/lib/test_merchant_api.c | 23 +++++++++++++++++++----
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/src/backenddb/plugin_merchantdb_postgres.c
b/src/backenddb/plugin_merchantdb_postgres.c
index 9de6294..ff1aafc 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -826,6 +826,12 @@ postgres_store_transfer_to_proof (void *cls,
* @param merchant_pub instance's public key; only rows related to this
* instance are returned.
* @param start only rows with serial id less than start are returned.
+ * In other words, you lower `start` to get older records. The tipical
+ * usage is to firstly call `find_proposal_data_by_date`, so that you get
+ * the `nrows` youngest records. The oldest of those records will tell you
+ * from which timestamp and `start` you can query the DB in order to get
+ * furtherly older records, and so on. Alternatively, you can use always
+ * the same timestamp and just go behind in history by tuning `start`.
* @param nrows only nrows rows are returned.
* @param cb function to call with transaction data, can be NULL.
* @param cb_cls closure for @a cb
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
index 58075c0..5e68332 100644
--- a/src/lib/test_merchant_api.c
+++ b/src/lib/test_merchant_api.c
@@ -596,6 +596,17 @@ struct Command
*/
struct TALER_MERCHANT_HistoryOperation *ho;
+ /**
+ * The backend will return records with row_id
+ * less than this value.
+ */
+ unsigned int start;
+
+ /**
+ * The backend will return at most `nrows` records.
+ */
+ unsigned int nrows;
+
} history;
@@ -1850,8 +1861,8 @@ interpreter_run (void *cls)
(cmd->details.history.ho = TALER_MERCHANT_history (ctx,
MERCHANT_URI,
instance,
- 20,
- 20,
+
cmd->details.history.start,
+
cmd->details.history.nrows,
cmd->details.history.date,
history_cb,
is)))
@@ -2342,14 +2353,18 @@ run (void *cls)
.expected_response_code = MHD_HTTP_OK,
/*all records to be returned*/
.details.history.date.abs_value_us = 43 * 1000LL * 1000LL,
- .details.history.nresult = 2
+ .details.history.nresult = 2,
+ .details.history.start = 10,
+ .details.history.nrows = 10
},
{ .oc = OC_HISTORY,
.label = "history-2",
.expected_response_code = MHD_HTTP_OK,
/*no records returned, time limit too ancient*/
.details.history.date.abs_value_us = 0,
- .details.history.nresult = 0
+ .details.history.nresult = 0,
+ .details.history.start = 10,
+ .details.history.nrows = 10
},
/* end of testcase */
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: 'start' and 'nrows' not hardcoded anymore in testcase.,
gnunet <=