summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/exchange/taler-exchange-httpd_config.h2
-rw-r--r--src/include/taler_json_lib.h2
-rw-r--r--src/include/taler_util.h2
-rw-r--r--src/json/json_helper.c7
-rw-r--r--src/lib/exchange_api_handle.c7
-rw-r--r--src/util/config.c2
6 files changed, 13 insertions, 9 deletions
diff --git a/src/exchange/taler-exchange-httpd_config.h b/src/exchange/taler-exchange-httpd_config.h
index f3e67e371..362667aca 100644
--- a/src/exchange/taler-exchange-httpd_config.h
+++ b/src/exchange/taler-exchange-httpd_config.h
@@ -41,7 +41,7 @@
*
* Returned via both /config and /keys endpoints.
*/
-#define EXCHANGE_PROTOCOL_VERSION "17:1:0"
+#define EXCHANGE_PROTOCOL_VERSION "18:0:1"
/**
diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h
index 51fd17dd0..31fd7f196 100644
--- a/src/include/taler_json_lib.h
+++ b/src/include/taler_json_lib.h
@@ -234,12 +234,14 @@ TALER_JSON_spec_amount (const char *name,
* a currency specification.
*
* @param name name of the amount field in the JSON
+ * @param currency_code currency code to parse
* @param[out] r_cspec where the currency spec has to be written
* @return spec for parsing an amount
*/
struct GNUNET_JSON_Specification
TALER_JSON_spec_currency_specification (
const char *name,
+ const char *currency_code,
struct TALER_CurrencySpecification *r_cspec);
diff --git a/src/include/taler_util.h b/src/include/taler_util.h
index 7c2cc6880..7d5542a1b 100644
--- a/src/include/taler_util.h
+++ b/src/include/taler_util.h
@@ -215,7 +215,7 @@ TALER_config_get_currency (const struct GNUNET_CONFIGURATION_Handle *cfg,
struct TALER_CurrencySpecification
{
/**
- * Name of the currency.
+ * Currency code of the currency.
*/
char currency[TALER_CURRENCY_LEN];
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
index 450cc194c..e1670d0dc 100644
--- a/src/json/json_helper.c
+++ b/src/json/json_helper.c
@@ -162,15 +162,13 @@ parse_cspec (void *cls,
struct GNUNET_JSON_Specification *spec)
{
struct TALER_CurrencySpecification *r_cspec = spec->ptr;
+ const char *currency = spec->cls;
const char *name;
- const char *currency;
uint32_t fid;
uint32_t fnd;
uint32_t ftzd;
const json_t *map;
struct GNUNET_JSON_Specification gspec[] = {
- GNUNET_JSON_spec_string ("currency",
- &currency),
GNUNET_JSON_spec_string ("name",
&name),
GNUNET_JSON_spec_uint32 ("num_fractional_input_digits",
@@ -257,12 +255,13 @@ clean_cspec (void *cls,
struct GNUNET_JSON_Specification
TALER_JSON_spec_currency_specification (
const char *name,
+ const char *currency,
struct TALER_CurrencySpecification *r_cspec)
{
struct GNUNET_JSON_Specification ret = {
.parser = &parse_cspec,
.cleaner = &clean_cspec,
- .cls = NULL,
+ .cls = currency,
.field = name,
.ptr = r_cspec,
.ptr_size = 0,
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index 4b0298744..ed491c8bc 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -850,9 +850,6 @@ decode_keys_json (const json_t *resp_obj,
GNUNET_JSON_spec_string (
"currency",
&currency),
- TALER_JSON_spec_currency_specification (
- "currency_specification",
- &key_data->cspec),
GNUNET_JSON_spec_string (
"asset_type",
&asset_type),
@@ -913,6 +910,10 @@ decode_keys_json (const json_t *resp_obj,
}
{
struct GNUNET_JSON_Specification sspec[] = {
+ TALER_JSON_spec_currency_specification (
+ "currency_specification",
+ currency,
+ &key_data->cspec),
TALER_JSON_spec_amount (
"stefan_abs",
currency,
diff --git a/src/util/config.c b/src/util/config.c
index 188969c6f..f5accaad8 100644
--- a/src/util/config.c
+++ b/src/util/config.c
@@ -477,6 +477,8 @@ TALER_CONFIG_currency_specs_to_json (const struct
return GNUNET_JSON_PACK (
GNUNET_JSON_pack_string ("name",
cspec->name),
+ /* 'currency' is deprecated as of exchange v18 and merchant v6;
+ remove this line once current-age > 6*/
GNUNET_JSON_pack_string ("currency",
cspec->currency),
GNUNET_JSON_pack_uint64 ("num_fractional_input_digits",