From b8f25a07e94cc9f421a547e8d6c9c8026d39f710 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Mon, 20 Mar 2017 16:09:18 +0100 Subject: Fix lib testcase. --- src/backend/taler-merchant-httpd_history.c | 43 ++++++++---------------------- 1 file changed, 11 insertions(+), 32 deletions(-) (limited to 'src/backend/taler-merchant-httpd_history.c') diff --git a/src/backend/taler-merchant-httpd_history.c b/src/backend/taler-merchant-httpd_history.c index 44e8216c..e7bd12dc 100644 --- a/src/backend/taler-merchant-httpd_history.c +++ b/src/backend/taler-merchant-httpd_history.c @@ -35,12 +35,6 @@ static int start = -1; */ static unsigned int delta; -/** - * Index to the current row being processed. - */ -static unsigned int current = 0; - - /** * Function called with information about a transaction. * @@ -60,33 +54,23 @@ pd_cb (void *cls, json_t *amount; json_t *timestamp; json_t *instance; + uint64_t r64 = (uint64_t) row_id; GNUNET_assert (-1 != json_unpack ((json_t *) proposal_data, - "{s:o, s:o, s:{s:o}, s:I}", + "{s:o, s:o, s:{s:o}}", "amount", &amount, "timestamp", ×tamp, - "merchant", "instance", &instance, - "row_id", (json_int_t) row_id)); + "merchant", "instance", &instance)); - if ( (current >= start) && - (current < start + delta) ) - { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Adding history element. Current: %u, start: %u, delta: %u\n", - current, - start, - delta); - GNUNET_break (NULL != (entry = json_pack ("{s:s, s:O, s:O, s:O}", - "order_id", order_id, - "amount", amount, - "timestamp", timestamp, - "instance", instance))); - - GNUNET_break (0 == json_array_append_new (response, - entry)); - } + GNUNET_break (NULL != (entry = json_pack ("{s:I, s:s, s:O, s:O, s:O}", + "row_id", r64, + "order_id", order_id, + "amount", amount, + "timestamp", timestamp, + "instance", instance))); - current++; + GNUNET_break (0 == json_array_append_new (response, + entry)); } @@ -206,11 +190,6 @@ MH_handler_history (struct TMH_RequestHandler *rh, delta, pd_cb, response); - - - - - current = 0; if (GNUNET_SYSERR == ret) { json_decref (response); -- cgit v1.2.3