[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: do not accept legitimization rul
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: do not accept legitimization rules that are for the wrong currency |
Date: |
Fri, 13 Dec 2024 13:27:09 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new c4dd25175 do not accept legitimization rules that are for the wrong
currency
c4dd25175 is described below
commit c4dd25175d80dd1500d31be2b91af9b6411ce27f
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Dec 13 13:26:50 2024 +0100
do not accept legitimization rules that are for the wrong currency
---
src/kyclogic/kyclogic_api.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c
index 15275d4bb..07eb2697d 100644
--- a/src/kyclogic/kyclogic_api.c
+++ b/src/kyclogic/kyclogic_api.c
@@ -336,6 +336,11 @@ static unsigned int num_aml_programs;
*/
static char *cfg_filename;
+/**
+ * Currency we expect to see in all rules.
+ */
+static char *my_currency;
+
struct GNUNET_TIME_Timestamp
TALER_KYCLOGIC_rules_get_expiration (
@@ -630,8 +635,9 @@ TALER_KYCLOGIC_rules_parse (const json_t *jlrs)
struct GNUNET_JSON_Specification ispec[] = {
TALER_JSON_spec_kycte ("operation_type",
&rule->trigger),
- TALER_JSON_spec_amount_any ("threshold",
- &rule->threshold),
+ TALER_JSON_spec_amount ("threshold",
+ my_currency,
+ &rule->threshold),
GNUNET_JSON_spec_relative_time ("timeframe",
&rule->timeframe),
GNUNET_JSON_spec_array_const ("measures",
@@ -901,8 +907,9 @@ TALER_KYCLOGIC_rules_to_limits (const json_t *jrules)
&operation_type),
GNUNET_JSON_spec_relative_time ("timeframe",
&timeframe),
- TALER_JSON_spec_amount_any ("threshold",
- &threshold),
+ TALER_JSON_spec_amount ("threshold",
+ my_currency,
+ &threshold),
GNUNET_JSON_spec_array_const ("measures",
&jmeasures),
GNUNET_JSON_spec_mark_optional (
@@ -2775,6 +2782,10 @@ TALER_KYCLOGIC_kyc_init (
json_t *jkyc_rules;
cfg_filename = GNUNET_strdup (cfg_fn);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_config_get_currency (cfg,
+ "exchange",
+ &my_currency));
GNUNET_CONFIGURATION_iterate_sections (cfg,
&handle_provider_section,
&sc);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: do not accept legitimization rules that are for the wrong currency,
gnunet <=