merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 5532fdfdd1bc986afc5d52e9ba909b826afbb86e
parent 60ff8720245d90ade29e0c8637404bab82cb0c1b
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Tue,  5 Mar 2019 17:41:57 +0100

Benchmark.

Taking the currency from CLI arguments as well, as there
was no need to parse the config just to fetch this value.

Diffstat:
Msrc/merchant-tools/taler-merchant-benchmark.c | 35+++++++++++++----------------------
1 file changed, 13 insertions(+), 22 deletions(-)

diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c @@ -46,7 +46,7 @@ enum PaymentGeneratorError { MISSING_BANK_URL, FAILED_TO_LAUNCH_BANK, BAD_CLI_ARG, - BAD_CONFIG_FILE + MISSING_CURRENCY }; /* Hard-coded params. Note, the bank is expected to @@ -520,7 +520,6 @@ run (void *cls, fprintf (stderr, "None of 'ordinary' or 'corner'" " subcommands were given\n"); - result = 1; } @@ -614,6 +613,13 @@ main (int argc, &merchant_url), GNUNET_GETOPT_option_string + ('k', + "currency", + "K", + "Used currency, mandatory", + &currency), + + GNUNET_GETOPT_option_string ('i', "alt-instance", "AI", @@ -729,7 +735,8 @@ main (int argc, if (GNUNET_YES == root_help) { - fprintf (stdout, root_help_str); + fprintf (stdout, + root_help_str); return 0; } @@ -760,27 +767,11 @@ main (int argc, if (NULL == cfg_filename) cfg_filename = (char *) default_config_file; - cfg = GNUNET_CONFIGURATION_create (); - if (GNUNET_OK != GNUNET_CONFIGURATION_load - (cfg, - cfg_filename)) - { - TALER_LOG_ERROR ("Could not parse configuration\n"); - return BAD_CONFIG_FILE; - } - if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string - (cfg, - "taler", - "currency", - &currency)) + if (NULL == currency) { - GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "taler", - "currency"); - GNUNET_CONFIGURATION_destroy (cfg); - return BAD_CONFIG_FILE; + TALER_LOG_ERROR ("Option -k is mandatory!\n"); + return MISSING_CURRENCY; } - GNUNET_CONFIGURATION_destroy (cfg); if (NULL == merchant_url) {