aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_post_orders.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-10-28 21:05:53 +0200
committerChristian Grothoff <christian@grothoff.org>2021-10-28 21:05:53 +0200
commit7d23dbe6ee21afc6d28df50516e694f205aada29 (patch)
treec703abe21ce038f68b12c1653df9049a856446df /src/testing/testing_api_cmd_post_orders.c
parentca87a98695221ea3b8beb08c40cf04f6afe7bd2c (diff)
-work on FTBFS
Diffstat (limited to 'src/testing/testing_api_cmd_post_orders.c')
-rw-r--r--src/testing/testing_api_cmd_post_orders.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/testing/testing_api_cmd_post_orders.c b/src/testing/testing_api_cmd_post_orders.c
index f7c00388..1813385d 100644
--- a/src/testing/testing_api_cmd_post_orders.c
+++ b/src/testing/testing_api_cmd_post_orders.c
@@ -63,7 +63,7 @@ struct OrdersState
/**
* Contract terms hash code.
*/
- struct GNUNET_HashCode h_contract_terms;
+ struct TALER_PrivateContractHash h_contract_terms;
/**
* The /orders operation handle.
@@ -149,23 +149,21 @@ struct OrdersState
* @param index index number of the object to extract.
* @return #GNUNET_OK on success
*/
-static int
+static enum GNUNET_GenericReturnValue
orders_traits (void *cls,
const void **ret,
const char *trait,
unsigned int index)
{
struct OrdersState *ps = cls;
-
struct TALER_TESTING_Trait traits[] = {
- TALER_TESTING_make_trait_order_id (0, ps->order_id),
- TALER_TESTING_make_trait_contract_terms (0, ps->contract_terms),
- TALER_TESTING_make_trait_h_contract_terms (0, &ps->h_contract_terms),
- TALER_TESTING_make_trait_merchant_sig (0, &ps->merchant_sig),
- TALER_TESTING_make_trait_merchant_pub (0, &ps->merchant_pub),
- TALER_TESTING_make_trait_claim_nonce (0, &ps->nonce),
- TALER_TESTING_make_trait_claim_token (0, &ps->claim_token),
- TALER_TESTING_make_trait_string (0, ps->order),
+ TALER_TESTING_make_trait_order_id (&ps->order_id),
+ TALER_TESTING_make_trait_contract_terms (ps->contract_terms),
+ TALER_TESTING_make_trait_h_contract_terms (&ps->h_contract_terms),
+ TALER_TESTING_make_trait_merchant_sig (&ps->merchant_sig),
+ TALER_TESTING_make_trait_merchant_pub (&ps->merchant_pub),
+ TALER_TESTING_make_trait_claim_nonce (&ps->nonce),
+ TALER_TESTING_make_trait_claim_token (&ps->claim_token),
TALER_TESTING_trait_end ()
};
@@ -192,7 +190,7 @@ orders_claim_cb (void *cls,
const struct TALER_MERCHANT_HttpResponse *hr,
const json_t *contract_terms,
const struct TALER_MerchantSignatureP *sig,
- const struct GNUNET_HashCode *hash)
+ const struct TALER_PrivateContractHash *hash)
{
struct OrdersState *ps = cls;
struct TALER_MerchantPublicKeyP merchant_pub;
@@ -292,7 +290,6 @@ order_cb (void *cls,
ps->duplicate_of);
if (GNUNET_OK !=
TALER_TESTING_get_trait_claim_token (order_cmd,
- 0,
&prev_token))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -446,23 +443,28 @@ orders_run2 (void *cls,
if (NULL != ps->duplicate_of)
{
const struct TALER_TESTING_Command *order_cmd;
+ const json_t *ct;
+
order_cmd = TALER_TESTING_interpreter_lookup_command (
is,
ps->duplicate_of);
if (GNUNET_OK !=
- TALER_TESTING_get_trait_string (order_cmd,
- 0,
- &order_str))
+ TALER_TESTING_get_trait_contract_terms (order_cmd,
+ &ct))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Could not fetch previous order string\n");
TALER_TESTING_interpreter_fail (is);
return;
}
+ order = json_incref ((json_t *) ct);
+ }
+ else
+ {
+ order = json_loads (order_str,
+ JSON_REJECT_DUPLICATES,
+ &error);
}
- order = json_loads (order_str,
- JSON_REJECT_DUPLICATES,
- &error);
if (NULL == order)
{
// human error here.
@@ -527,16 +529,15 @@ orders_run2 (void *cls,
token = strtok (NULL, ";"))
{
const struct TALER_TESTING_Command *lock_cmd;
- const char *uuid;
+ const char **uuid;
lock_cmd = TALER_TESTING_interpreter_lookup_command (
is,
token);
if (GNUNET_OK !=
- TALER_TESTING_get_trait_string (lock_cmd,
- 0,
- &uuid))
+ TALER_TESTING_get_trait_lock_uuid (lock_cmd,
+ &uuid))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Could not fetch lock uuid\n");
@@ -546,7 +547,7 @@ orders_run2 (void *cls,
GNUNET_array_append (locks,
locks_length,
- uuid);
+ *uuid);
}
ps->po = TALER_MERCHANT_orders_post2 (is->ctx,
ps->merchant_url,
@@ -777,7 +778,6 @@ TALER_TESTING_cmd_merchant_post_orders2 (
pay_deadline,
amount,
&ps->order);
-
ps->http_status = http_status;
ps->expected_order_id = order_id;
ps->merchant_url = merchant_url;