diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2022-06-27 10:36:13 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2022-06-27 10:36:13 +0200 |
commit | 5633ad5a26d435c32b0df2b757950c416c6faaec (patch) | |
tree | 3937f9f21f394ffbf6798f7561e054f8367710ba /src/json | |
parent | a6544069f98fdbfce4ac215dd5f0ee0660469c2c (diff) |
better api for parsing a denomination group
Diffstat (limited to 'src/json')
-rw-r--r-- | src/json/json_helper.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/json/json_helper.c b/src/json/json_helper.c index b29a49b3a..202caf6f1 100644 --- a/src/json/json_helper.c +++ b/src/json/json_helper.c @@ -250,16 +250,17 @@ parse_denomination_group (void *cls, { struct TALER_DenominationGroup *group = spec->ptr; const char *cipher; + const char *currency = cls; bool age_mask_missing = false; bool has_age_restricted_suffix = false; struct GNUNET_JSON_Specification gspec[] = { GNUNET_JSON_spec_string ("cipher", &cipher), TALER_JSON_spec_amount ("value", - group->currency, + currency, &group->value), TALER_JSON_SPEC_DENOM_FEES ("fee", - group->currency, + currency, &group->fees), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_uint32 ("age_mask", @@ -307,9 +308,11 @@ parse_denomination_group (void *cls, struct GNUNET_JSON_Specification TALER_JSON_spec_denomination_group (const char *name, + const char *currency, struct TALER_DenominationGroup *group) { struct GNUNET_JSON_Specification ret = { + .cls = (void *) currency, .parser = &parse_denomination_group, .cleaner = NULL, .field = name, @@ -318,7 +321,6 @@ TALER_JSON_spec_denomination_group (const char *name, .size_ptr = NULL, }; - return ret; } |