summaryrefslogtreecommitdiff
path: root/src/json/json.c
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-06-16 11:45:44 +0200
committerFlorian Dold <florian@dold.me>2021-06-16 11:45:44 +0200
commitffb24f5b59a2cc3ef84b1fe9e8c36a341e60646d (patch)
tree52b05f5c1eed5fba327ea23d961842fc7c1ef6fa /src/json/json.c
parentae60be7644699940f3596bc8f9674d36cbe22e25 (diff)
downloadexchange-ffb24f5b59a2cc3ef84b1fe9e8c36a341e60646d.tar.gz
exchange-ffb24f5b59a2cc3ef84b1fe9e8c36a341e60646d.tar.bz2
exchange-ffb24f5b59a2cc3ef84b1fe9e8c36a341e60646d.zip
use dollar to prefix reserved JSON names
Diffstat (limited to 'src/json/json.c')
-rw-r--r--src/json/json.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/json/json.c b/src/json/json.c
index c480d1b2e..a730e1e42 100644
--- a/src/json/json.c
+++ b/src/json/json.c
@@ -180,9 +180,9 @@ forget (const json_t *in)
json_t *rx;
fg = json_object_get (in,
- "_forgettable");
+ "$forgettable");
rx = json_object_get (in,
- "_forgotten");
+ "$forgotten");
if (NULL != rx)
rx = json_deep_copy (rx); /* should be shallow
by structure, but
@@ -292,7 +292,7 @@ forget (const json_t *in)
if ( (NULL != rx) &&
(0 !=
json_object_set_new (ret,
- "_forgotten",
+ "$forgotten",
rx)) )
{
GNUNET_break (0);
@@ -321,6 +321,11 @@ TALER_JSON_contract_hash (const json_t *json,
GNUNET_break (0);
return GNUNET_SYSERR;
}
+
+ char *enc = json_dumps (cjson,
+ JSON_ENCODE_ANY
+ | JSON_COMPACT
+ | JSON_SORT_KEYS);
ret = dump_and_hash (cjson,
NULL,
hc);
@@ -365,13 +370,13 @@ TALER_JSON_contract_mark_forgettable (json_t *json,
return GNUNET_SYSERR;
}
fg = json_object_get (json,
- "_forgettable");
+ "$forgettable");
if (NULL == fg)
{
fg = json_object ();
if (0 !=
json_object_set_new (json,
- "_forgettable",
+ "$forgettable",
fg))
{
GNUNET_break (0);
@@ -419,22 +424,22 @@ TALER_JSON_contract_part_forget (json_t *json,
return GNUNET_SYSERR;
}
fg = json_object_get (json,
- "_forgettable");
+ "$forgettable");
if (NULL == fg)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Did not find _forgettable attribute trying to forget field `%s'\n",
+ "Did not find '$forgettable' attribute trying to forget field `%s'\n",
field);
return GNUNET_SYSERR;
}
rx = json_object_get (json,
- "_forgotten");
+ "$forgotten");
if (NULL == rx)
{
rx = json_object ();
if (0 !=
json_object_set_new (json,
- "_forgotten",
+ "$forgotten",
rx))
{
GNUNET_break (0);