aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_merchant_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-07-30 23:31:02 +0200
committerChristian Grothoff <christian@grothoff.org>2024-07-30 23:31:02 +0200
commit01fa3466e15d70cbd1e4719843ae39eff07eb229 (patch)
tree77f02e07d1eda741cd593fe1af597769b8ef1eac /src/testing/test_merchant_api.c
parent195971f7dac9820a8fdd68ec574d1a99d6f7343b (diff)
fix FTBFS when compiling against exchange v0.13 API
Diffstat (limited to 'src/testing/test_merchant_api.c')
-rw-r--r--src/testing/test_merchant_api.c217
1 files changed, 117 insertions, 100 deletions
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index 28c32c2f..5cc2cc67 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -44,7 +44,7 @@
* commands should NOT wait for this timeout!
*/
#define POLL_ORDER_TIMEOUT \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
/**
* The 'poll-orders-conclude-1x' and other 'conclude'
@@ -52,7 +52,7 @@
* here we use a short value!
*/
#define POLL_ORDER_SHORT_TIMEOUT \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2)
/**
* Configuration file we use. One (big) configuration is used
@@ -174,8 +174,8 @@ cmd_exec_wirewatch (const char *label)
* @param label label to use for the command.
*/
#define CMD_EXEC_AGGREGATOR(label) \
- TALER_TESTING_cmd_exec_aggregator (label "-aggregator", config_file), \
- TALER_TESTING_cmd_exec_transfer (label "-transfer", config_file)
+ TALER_TESTING_cmd_exec_aggregator (label "-aggregator", config_file), \
+ TALER_TESTING_cmd_exec_transfer (label "-transfer", config_file)
/**
@@ -208,23 +208,25 @@ run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct TALER_TESTING_Command get_private_order_id[] = {
- TALER_TESTING_cmd_merchant_post_instances ("instance-create-default",
- merchant_url,
- "default",
- MHD_HTTP_NO_CONTENT),
+ TALER_TESTING_cmd_merchant_post_instances (
+ "instance-create-default",
+ merchant_url,
+ "default",
+ MHD_HTTP_NO_CONTENT),
TALER_TESTING_cmd_merchant_post_account (
"instance-create-default-account",
merchant_url,
PAYTO_I1,
NULL, NULL,
MHD_HTTP_OK),
- TALER_TESTING_cmd_merchant_kyc_get ("instance-create-kyc-0",
- merchant_url,
- NULL,
- NULL,
- EXCHANGE_URL,
- MHD_HTTP_NO_CONTENT,
- TALER_AML_NORMAL),
+ TALER_TESTING_cmd_merchant_kyc_get (
+ "instance-create-kyc-0",
+ merchant_url,
+ NULL,
+ NULL,
+ EXCHANGE_URL,
+ MHD_HTTP_NO_CONTENT,
+ false),
TALER_TESTING_cmd_merchant_post_orders_no_claim (
"create-proposal-bad-currency",
merchant_url,
@@ -233,28 +235,32 @@ run (void *cls,
GNUNET_TIME_UNIT_ZERO_TS,
GNUNET_TIME_UNIT_FOREVER_TS,
"CHF:5.0"),
- TALER_TESTING_cmd_merchant_post_orders_no_claim ("create-proposal-4",
- merchant_url,
- MHD_HTTP_OK,
- "4",
- GNUNET_TIME_UNIT_ZERO_TS,
- GNUNET_TIME_UNIT_FOREVER_TS,
- "EUR:5.0"),
- TALER_TESTING_cmd_merchant_get_order ("get-order-4",
- merchant_url,
- "create-proposal-4",
- TALER_MERCHANT_OSC_UNPAID,
- false,
- MHD_HTTP_OK,
- NULL),
- TALER_TESTING_cmd_merchant_delete_order ("delete-order-4",
- merchant_url,
- "4",
- MHD_HTTP_NO_CONTENT),
- TALER_TESTING_cmd_merchant_purge_instance ("purge-default",
- merchant_url,
- "default",
- MHD_HTTP_NO_CONTENT),
+ TALER_TESTING_cmd_merchant_post_orders_no_claim (
+ "create-proposal-4",
+ merchant_url,
+ MHD_HTTP_OK,
+ "4",
+ GNUNET_TIME_UNIT_ZERO_TS,
+ GNUNET_TIME_UNIT_FOREVER_TS,
+ "EUR:5.0"),
+ TALER_TESTING_cmd_merchant_get_order (
+ "get-order-4",
+ merchant_url,
+ "create-proposal-4",
+ TALER_MERCHANT_OSC_UNPAID,
+ false,
+ MHD_HTTP_OK,
+ NULL),
+ TALER_TESTING_cmd_merchant_delete_order (
+ "delete-order-4",
+ merchant_url,
+ "4",
+ MHD_HTTP_NO_CONTENT),
+ TALER_TESTING_cmd_merchant_purge_instance (
+ "purge-default",
+ merchant_url,
+ "default",
+ MHD_HTTP_NO_CONTENT),
TALER_TESTING_cmd_end ()
};
@@ -626,7 +632,8 @@ run (void *cls,
5,
0,
json_object (),
- GNUNET_TIME_relative_to_timestamp (
+ GNUNET_TIME_relative_to_timestamp
+ (
GNUNET_TIME_UNIT_MINUTES),
MHD_HTTP_NO_CONTENT),
TALER_TESTING_cmd_merchant_lock_product ("lock-product-p3",
@@ -1682,35 +1689,41 @@ run (void *cls,
"EUR:5",
0,
MHD_HTTP_OK),
- TALER_TESTING_cmd_merchant_post_tokenfamilies ("create-upcoming-tokenfamily",
- merchant_url,
- MHD_HTTP_NO_CONTENT,
- "subscription-upcoming",
- "Upcoming Subscription",
- "An upcoming subscription that is not valid yet.",
- NULL,
- /* In one day */
- GNUNET_TIME_absolute_to_timestamp (
- GNUNET_TIME_absolute_add (
- GNUNET_TIME_timestamp_get ().abs_time, GNUNET_TIME_UNIT_DAYS)),
- /* In a year */
- GNUNET_TIME_absolute_to_timestamp (
- GNUNET_TIME_absolute_add (
- GNUNET_TIME_timestamp_get ().abs_time, GNUNET_TIME_UNIT_YEARS)),
- GNUNET_TIME_UNIT_MONTHS,
- GNUNET_TIME_UNIT_MONTHS,
- "subscription"),
- TALER_TESTING_cmd_merchant_post_orders_choices ("create-order-with-upcoming-output",
- cred.cfg,
- merchant_url,
- MHD_HTTP_CONFLICT,
- "create-upcoming-tokenfamily",
- 0,
- 1,
- "5-upcoming-output",
- GNUNET_TIME_UNIT_ZERO_TS,
- GNUNET_TIME_UNIT_FOREVER_TS,
- "EUR:5.0"),
+ TALER_TESTING_cmd_merchant_post_tokenfamilies (
+ "create-upcoming-tokenfamily",
+ merchant_url,
+ MHD_HTTP_NO_CONTENT,
+ "subscription-upcoming",
+ "Upcoming Subscription",
+ "An upcoming subscription that is not valid yet.",
+ NULL,
+ /* In one day */
+ GNUNET_TIME_absolute_to_timestamp
+ (
+ GNUNET_TIME_absolute_add (
+ GNUNET_TIME_timestamp_get ()
+ .abs_time, GNUNET_TIME_UNIT_DAYS)),
+ /* In a year */
+ GNUNET_TIME_absolute_to_timestamp
+ (
+ GNUNET_TIME_absolute_add (
+ GNUNET_TIME_timestamp_get ()
+ .abs_time, GNUNET_TIME_UNIT_YEARS)),
+ GNUNET_TIME_UNIT_MONTHS,
+ GNUNET_TIME_UNIT_MONTHS,
+ "subscription"),
+ TALER_TESTING_cmd_merchant_post_orders_choices (
+ "create-order-with-upcoming-output",
+ cred.cfg,
+ merchant_url,
+ MHD_HTTP_CONFLICT,
+ "create-upcoming-tokenfamily",
+ 0,
+ 1,
+ "5-upcoming-output",
+ GNUNET_TIME_UNIT_ZERO_TS,
+ GNUNET_TIME_UNIT_FOREVER_TS,
+ "EUR:5.0"),
TALER_TESTING_cmd_merchant_post_tokenfamilies ("create-tokenfamily",
merchant_url,
MHD_HTTP_NO_CONTENT,
@@ -1719,7 +1732,8 @@ run (void *cls,
"A subscription.",
NULL,
GNUNET_TIME_UNIT_ZERO_TS,
- GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_YEARS),
+ GNUNET_TIME_relative_to_timestamp
+ (GNUNET_TIME_UNIT_YEARS),
GNUNET_TIME_UNIT_MONTHS,
GNUNET_TIME_UNIT_MONTHS,
"subscription"),
@@ -1744,27 +1758,29 @@ run (void *cls,
NULL,
0,
NULL),
- TALER_TESTING_cmd_merchant_post_orders_choices ("create-order-with-input-and-output",
- cred.cfg,
- merchant_url,
- MHD_HTTP_OK,
- "create-tokenfamily",
- 1,
- 1,
- "5-input-output",
- GNUNET_TIME_UNIT_ZERO_TS,
- GNUNET_TIME_UNIT_FOREVER_TS,
- "EUR:0.0"),
- TALER_TESTING_cmd_merchant_pay_order_choices ("pay-order-with-input-and-output",
- merchant_url,
- MHD_HTTP_OK,
- "create-order-with-input-and-output",
- "",
- "EUR:0",
- "EUR:0",
- NULL,
- 0,
- "pay-order-with-output"),
+ TALER_TESTING_cmd_merchant_post_orders_choices (
+ "create-order-with-input-and-output",
+ cred.cfg,
+ merchant_url,
+ MHD_HTTP_OK,
+ "create-tokenfamily",
+ 1,
+ 1,
+ "5-input-output",
+ GNUNET_TIME_UNIT_ZERO_TS,
+ GNUNET_TIME_UNIT_FOREVER_TS,
+ "EUR:0.0"),
+ TALER_TESTING_cmd_merchant_pay_order_choices (
+ "pay-order-with-input-and-output",
+ merchant_url,
+ MHD_HTTP_OK,
+ "create-order-with-input-and-output",
+ "",
+ "EUR:0",
+ "EUR:0",
+ NULL,
+ 0,
+ "pay-order-with-output"),
// TALER_TESTING_cmd_merchant_pay_order_choices ("idempotent-pay-order-with-input-and-output",
// merchant_url,
// MHD_HTTP_OK,
@@ -1775,17 +1791,18 @@ run (void *cls,
// NULL,
// 0,
// "pay-order-with-output"),
- TALER_TESTING_cmd_merchant_post_orders_choices ("create-another-order-with-input-and-output",
- cred.cfg,
- merchant_url,
- MHD_HTTP_OK,
- "create-tokenfamily",
- 1,
- 1,
- "5-input-output-2",
- GNUNET_TIME_UNIT_ZERO_TS,
- GNUNET_TIME_UNIT_FOREVER_TS,
- "EUR:0.0"),
+ TALER_TESTING_cmd_merchant_post_orders_choices (
+ "create-another-order-with-input-and-output",
+ cred.cfg,
+ merchant_url,
+ MHD_HTTP_OK,
+ "create-tokenfamily",
+ 1,
+ 1,
+ "5-input-output-2",
+ GNUNET_TIME_UNIT_ZERO_TS,
+ GNUNET_TIME_UNIT_FOREVER_TS,
+ "EUR:0.0"),
TALER_TESTING_cmd_merchant_pay_order_choices ("double-spend-token",
merchant_url,
MHD_HTTP_CONFLICT,