summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_lock_product.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-09-02 14:10:54 +0200
committerChristian Grothoff <christian@grothoff.org>2021-09-02 14:10:58 +0200
commit4b8dc55c4330df6a3d2a552985afdd6a80737405 (patch)
tree3ca385ba66a0d39165765be0ca6ca13d415744e0 /src/testing/testing_api_cmd_lock_product.c
parent98d9dfb8c8637b8902e8b7f249834f807fa3e322 (diff)
downloadmerchant-4b8dc55c4330df6a3d2a552985afdd6a80737405.tar.gz
merchant-4b8dc55c4330df6a3d2a552985afdd6a80737405.tar.bz2
merchant-4b8dc55c4330df6a3d2a552985afdd6a80737405.zip
fix internal APIs and implemnetation to match new UUID specification based on application-defined strings; implement test for order creation with locks (#6932)
Diffstat (limited to 'src/testing/testing_api_cmd_lock_product.c')
-rw-r--r--src/testing/testing_api_cmd_lock_product.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/testing/testing_api_cmd_lock_product.c b/src/testing/testing_api_cmd_lock_product.c
index abb5920c..49f815d6 100644
--- a/src/testing/testing_api_cmd_lock_product.c
+++ b/src/testing/testing_api_cmd_lock_product.c
@@ -57,7 +57,7 @@ struct LockProductState
/**
* UUID that identifies the client holding the lock
*/
- struct GNUNET_Uuid uuid;
+ char *uuid;
/**
* duration how long should the lock be held
@@ -138,7 +138,7 @@ lock_product_run (void *cls,
pis->iph = TALER_MERCHANT_product_lock (is->ctx,
pis->merchant_url,
pis->product_id,
- &pis->uuid,
+ pis->uuid,
pis->duration,
pis->quantity,
&lock_product_cb,
@@ -166,6 +166,7 @@ lock_product_cleanup (void *cls,
"POST /product/$ID/lock operation did not complete\n");
TALER_MERCHANT_product_lock_cancel (pis->iph);
}
+ GNUNET_free (pis->uuid);
GNUNET_free (pis);
}
@@ -188,7 +189,7 @@ lock_product_traits (void *cls,
struct LockProductState *lps = cls;
struct TALER_TESTING_Trait traits[] = {
- TALER_TESTING_make_trait_uuid (0, &lps->uuid),
+ TALER_TESTING_make_trait_string (0, lps->uuid),
TALER_TESTING_trait_end ()
};
@@ -209,14 +210,17 @@ TALER_TESTING_cmd_merchant_lock_product (
unsigned int http_status)
{
struct LockProductState *pis;
+ struct GNUNET_Uuid uuid;
pis = GNUNET_new (struct LockProductState);
pis->merchant_url = merchant_url;
pis->product_id = product_id;
pis->http_status = http_status;
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
- &pis->uuid,
+ &uuid,
sizeof (struct GNUNET_Uuid));
+ pis->uuid = GNUNET_STRINGS_data_to_string_alloc (&uuid,
+ sizeof (uuid));
pis->duration = duration;
pis->quantity = quantity;