summaryrefslogtreecommitdiff
path: root/src/backenddb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-07-27 13:51:26 +0200
committerChristian Grothoff <christian@grothoff.org>2020-07-27 13:51:26 +0200
commit40761c7e877b89c800ef092075ab7ec616a9d19e (patch)
treee66b5add7a07ab47b6bc8f2354e060d395812d27 /src/backenddb
parentc03c8fe2d943347aeaea3b8c723c828b19f1ca4f (diff)
downloadmerchant-40761c7e877b89c800ef092075ab7ec616a9d19e.tar.gz
merchant-40761c7e877b89c800ef092075ab7ec616a9d19e.tar.bz2
merchant-40761c7e877b89c800ef092075ab7ec616a9d19e.zip
fix DB test
Diffstat (limited to 'src/backenddb')
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c6
-rw-r--r--src/backenddb/test_merchantdb.c6
2 files changed, 11 insertions, 1 deletions
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;