From 54e63f01df85ee0470493c6d0de29576ce3371c4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 5 Jul 2020 21:54:11 +0200 Subject: fix #6408: make sure all timestamps are always rounded when they arrive over JSON, or 400 the requester; similarly don't tolerate anything else as client --- src/include/taler_json_lib.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/include/taler_json_lib.h') diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h index 094cbe2e..fbc8785d 100644 --- a/src/include/taler_json_lib.h +++ b/src/include/taler_json_lib.h @@ -80,6 +80,31 @@ TALER_JSON_spec_amount_nbo (const char *name, struct TALER_AmountNBO *r_amount); +/** + * Provide specification to parse given JSON object to an absolute time. + * The absolute time value is expected to be already rounded. + * + * @param name name of the time field in the JSON + * @param[out] r_time where the time has to be written + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_absolute_time (const char *name, + struct GNUNET_TIME_Absolute *r_time); + + +/** + * Provide specification to parse given JSON object to an absolute time + * in network byte order. + * The absolute time value is expected to be already rounded. + * + * @param name name of the time field in the JSON + * @param[out] r_time where the time has to be written + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_absolute_time_nbo (const char *name, + struct GNUNET_TIME_AbsoluteNBO *r_time); + + /** * Generate line in parser specification for denomination public key. * -- cgit v1.2.3