From 4b8dc55c4330df6a3d2a552985afdd6a80737405 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 2 Sep 2021 14:10:54 +0200 Subject: fix internal APIs and implemnetation to match new UUID specification based on application-defined strings; implement test for order creation with locks (#6932) --- src/testing/testing_api_cmd_lock_product.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/testing/testing_api_cmd_lock_product.c') 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; -- cgit v1.2.3