merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 2e761cdd0b811f4a283c424ccdf5de4dcabd9eb3
parent 3ea60fbc60932ca411ad31df9dfd18dd1fb26016
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date:   Mon, 20 Mar 2017 15:37:30 +0100

Fix db testcase against newest plugin.

Diffstat:
Msrc/backenddb/plugin_merchantdb_postgres.c | 5++++-
Msrc/backenddb/test_merchantdb.c | 8++++----
2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c @@ -865,6 +865,8 @@ postgres_find_proposal_data_by_date_and_range (void *cls, if ( (0 == (n = PQntuples (result))) || (NULL == cb) ) { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "No records found.\n"); PQclear (result); return n; } @@ -927,6 +929,7 @@ postgres_find_proposal_data_by_date (void *cls, void *cb_cls) { + uint64_t r64 = nrows; struct PostgresClosure *pg = cls; PGresult *result; unsigned int n; @@ -935,7 +938,7 @@ postgres_find_proposal_data_by_date (void *cls, struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_absolute_time (&date), GNUNET_PQ_query_param_auto_from_type (merchant_pub), - GNUNET_PQ_query_param_uint32 (&nrows), + GNUNET_PQ_query_param_uint64 (&r64), GNUNET_PQ_query_param_end }; result = GNUNET_PQ_exec_prepared (pg->conn, diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c @@ -332,7 +332,7 @@ run (void *cls) timestamp = GNUNET_TIME_absolute_get(); GNUNET_TIME_round_abs (&timestamp); delta = GNUNET_TIME_UNIT_MINUTES; - fake_now = GNUNET_TIME_absolute_subtract (timestamp, delta); + fake_now = GNUNET_TIME_absolute_add (timestamp, delta); refund_deadline = GNUNET_TIME_absolute_get(); GNUNET_TIME_round_abs (&refund_deadline); GNUNET_assert (GNUNET_OK == @@ -382,8 +382,8 @@ run (void *cls) plugin->find_proposal_data_by_date_and_range (plugin->cls, fake_now, &merchant_pub, - 0, - 5, + 2, + 1, pd_cb, NULL)); @@ -391,7 +391,7 @@ run (void *cls) plugin->find_proposal_data_by_date (plugin->cls, fake_now, &merchant_pub, - 5, + 1, pd_cb, NULL));