From 40761c7e877b89c800ef092075ab7ec616a9d19e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 27 Jul 2020 13:51:26 +0200 Subject: fix DB test --- src/backenddb/plugin_merchantdb_postgres.c | 6 +++++- src/backenddb/test_merchantdb.c | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/backenddb') diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c index 84e1bceb..60f42a16 100644 --- a/src/backenddb/plugin_merchantdb_postgres.c +++ b/src/backenddb/plugin_merchantdb_postgres.c @@ -1331,6 +1331,7 @@ postgres_lookup_orders (void *cls, * @param instance_id identifies the instance responsible for the order * @param order_id alphanumeric string that uniquely identifies the proposal * @param pay_deadline how long does the customer have to pay for the order + * @param claim_token token to use for access control * @param contract_terms proposal data to store * @return transaction status */ @@ -1339,6 +1340,7 @@ postgres_insert_order (void *cls, const char *instance_id, const char *order_id, struct GNUNET_TIME_Absolute pay_deadline, + const struct TALER_ClaimTokenP *claim_token, const json_t *contract_terms) { struct PostgresClosure *pg = cls; @@ -1347,6 +1349,7 @@ postgres_insert_order (void *cls, GNUNET_PQ_query_param_string (instance_id), GNUNET_PQ_query_param_string (order_id), GNUNET_PQ_query_param_absolute_time (&pay_deadline), + GNUNET_PQ_query_param_auto_from_type (claim_token), GNUNET_PQ_query_param_absolute_time (&now), TALER_PQ_query_param_json (contract_terms), GNUNET_PQ_query_param_end @@ -7043,10 +7046,11 @@ libtaler_plugin_merchantdb_postgres_init (void *cls) "(merchant_serial" ",order_id" ",pay_deadline" + ",claim_token" ",creation_time" ",contract_terms)" " SELECT merchant_serial," - " $2, $3, $4, $5" + " $2, $3, $4, $5, $6" " FROM merchant_instances" " WHERE merchant_id=$1", 5), diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c index 12391d1d..fbbdaa18 100644 --- a/src/backenddb/test_merchantdb.c +++ b/src/backenddb/test_merchantdb.c @@ -1346,11 +1346,17 @@ test_insert_order (const struct InstanceData *instance, const struct OrderData *order, enum GNUNET_DB_QueryStatus expected_result) { + struct TALER_ClaimTokenP no_token; + + memset (&no_token, + 0, + sizeof (no_token)); TEST_COND_RET_ON_FAIL (expected_result == plugin->insert_order (plugin->cls, instance->instance.id, order->id, order->pay_deadline, + &no_token, order->contract), "Insert order failed\n"); return 0; -- cgit v1.2.3