commit 40761c7e877b89c800ef092075ab7ec616a9d19e
parent c03c8fe2d943347aeaea3b8c723c828b19f1ca4f
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 27 Jul 2020 13:51:26 +0200
fix DB test
Diffstat:
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git 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
@@ -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;
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
@@ -1000,6 +1000,7 @@ struct TALER_MERCHANTDB_Plugin
* @param instance_id identifies the instance responsible for the order
* @param order_id alphanumeric string that uniquely identifies the order
* @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
*/
@@ -1008,6 +1009,7 @@ struct TALER_MERCHANTDB_Plugin
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);