merchant

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

commit 9d6fba17b6231aeb2d741b74b6efe7ff8049364e
parent 862cb42ec7fa31f96b71ad4d53c25f8b77a6792a
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date:   Tue,  4 Oct 2016 16:10:35 +0200

stub for /history testing

Diffstat:
Msrc/backenddb/plugin_merchantdb_postgres.c | 6+++---
Msrc/lib/test_merchant_api.c | 28+++++++++++++++++++++++++++-
2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c @@ -547,7 +547,7 @@ postgres_store_transfer_to_proof (void *cls, * * @param cls our plugin handle * @param date limit to transactions' age - * @param cb function to call with transaction data + * @param cb function to call with transaction data, can be NULL * @param cb_cls closure for @a cb * @return numer of found tuples, #GNUNET_SYSERR upon error */ @@ -576,10 +576,10 @@ postgres_find_transactions_by_date (void *cls, PQclear (result); return GNUNET_SYSERR; } - if (0 == (n = PQntuples (result))) + if (0 == (n = PQntuples (result)) || NULL == cb) { PQclear (result); - return 0; + return n; } for (i = 0; i < n; i++) { diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c @@ -165,7 +165,12 @@ enum OpCode /** * Retrieve wire transfer details for a given transaction */ - OC_TRACK_TRANSACTION + OC_TRACK_TRANSACTION, + + /** + * Test getting transactions based on timestamp + */ + OC_HISTORY }; @@ -526,6 +531,27 @@ struct Command } track_transaction; + struct { + /** + * Date we want retrieved transactions younger than + */ + struct GNUNET_TIME_Absolute date; + + /** + * How many "rows" we expect in the result + */ + unsigned int nresult; + + /** + * Handle to the merchant + */ + + /*TBD*/ + + } history; + + + } details; };