diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2022-02-18 00:44:55 +0100 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2022-02-18 00:50:31 +0100 |
commit | f4f502d037a84a38db4bc21a1db06324a05d26aa (patch) | |
tree | abd1d813c9e1a9303d60edd3600a9e39f9d3d91a /src/util/config.c | |
parent | a78b3345fbf017b1cddfd09afb4b2c29287b0bba (diff) | |
parent | 22fe5da700df7328de183470c1c7f59b21c9f4f9 (diff) | |
download | exchange-f4f502d037a84a38db4bc21a1db06324a05d26aa.tar.xz |
-minor merge conflict resolves
Diffstat (limited to 'src/util/config.c')
-rw-r--r-- | src/util/config.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/util/config.c b/src/util/config.c index 8123b7343..dc342fdcf 100644 --- a/src/util/config.c +++ b/src/util/config.c @@ -59,6 +59,74 @@ TALER_config_get_amount (const struct GNUNET_CONFIGURATION_Handle *cfg, enum GNUNET_GenericReturnValue +TALER_config_get_denom_fees (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *currency, + const char *section, + struct TALER_DenomFeeSet *fees) +{ + if (GNUNET_OK != + TALER_config_get_amount (cfg, + section, + "FEE_WITHDRAW", + &fees->withdraw)) + { + GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + "Need amount for option `%s' in section `%s'\n", + "FEE_WITHDRAW", + section); + return GNUNET_SYSERR; + } + if (GNUNET_OK != + TALER_config_get_amount (cfg, + section, + "FEE_DEPOSIT", + &fees->deposit)) + { + GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + "Need amount for option `%s' in section `%s'\n", + "FEE_DEPOSIT", + section); + return GNUNET_SYSERR; + } + if (GNUNET_OK != + TALER_config_get_amount (cfg, + section, + "FEE_REFRESH", + &fees->refresh)) + { + GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + "Need amount for option `%s' in section `%s'\n", + "FEE_REFRESH", + section); + return GNUNET_SYSERR; + } + if (GNUNET_OK != + TALER_config_get_amount (cfg, + section, + "FEE_REFUND", + &fees->refund)) + { + GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + "Need amount for option `%s' in section `%s'\n", + "FEE_REFUND", + section); + return GNUNET_SYSERR; + } + if (GNUNET_OK != + TALER_denom_fee_check_currency (currency, + fees)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Need fee amounts in section `%s' to use currency `%s'\n", + section, + currency); + return GNUNET_SYSERR; + } + return GNUNET_OK; +} + + +enum GNUNET_GenericReturnValue TALER_config_get_currency (const struct GNUNET_CONFIGURATION_Handle *cfg, char **currency) { |