summaryrefslogtreecommitdiff
path: root/src/include/taler_json_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-17 15:10:14 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-17 15:18:09 +0100
commita351bfc4b4ca15ce7fd998cf9691e85cf84dc426 (patch)
tree88ec3b739914739f05d4c8cae2a2af40d29ebf82 /src/include/taler_json_lib.h
parent8bdf6ab19df70c16d335ecf82f2c3b2117eeb70e (diff)
downloadexchange-a351bfc4b4ca15ce7fd998cf9691e85cf84dc426.tar.gz
exchange-a351bfc4b4ca15ce7fd998cf9691e85cf84dc426.tar.bz2
exchange-a351bfc4b4ca15ce7fd998cf9691e85cf84dc426.zip
-fix CS nonce reuse check logic
Diffstat (limited to 'src/include/taler_json_lib.h')
-rw-r--r--src/include/taler_json_lib.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h
index e3e47222b..8a7e5cd8b 100644
--- a/src/include/taler_json_lib.h
+++ b/src/include/taler_json_lib.h
@@ -251,6 +251,35 @@ TALER_JSON_spec_amount_any_nbo (const char *name,
/**
+ * Generate specification to parse all fees for
+ * a denomination under a prefix @a pfx.
+ *
+ * @param pfx string prefix to use
+ * @param currency which currency to expect
+ * @param[out] dfs a `struct TALER_DenomFeeSet` to initialize
+ */
+#define TALER_JSON_SPEC_DENOM_FEES(pfx,currency,dfs) \
+ TALER_JSON_spec_amount (pfx "_withdraw", (currency), &(dfs)->withdraw), \
+ TALER_JSON_spec_amount (pfx "_deposit", (currency), &(dfs)->deposit), \
+ TALER_JSON_spec_amount (pfx "_refresh", (currency), &(dfs)->refresh), \
+ TALER_JSON_spec_amount (pfx "_refund", (currency), &(dfs)->refund)
+
+
+/**
+ * Macro to pack all of a denominations' fees under
+ * a given @a pfx.
+ *
+ * @param pfx string prefix to use
+ * @param dfs a `struct TALER_DenomFeeSet` to pack
+ */
+#define TALER_JSON_PACK_DENOM_FEES(pfx, dfs) \
+ TALER_JSON_pack_amount (pfx "_withdraw", &(dfs)->withdraw), \
+ TALER_JSON_pack_amount (pfx "_deposit", &(dfs)->deposit), \
+ TALER_JSON_pack_amount (pfx "_refresh", &(dfs)->refresh), \
+ TALER_JSON_pack_amount (pfx "_refund", &(dfs)->refund)
+
+
+/**
* Generate line in parser specification for denomination public key.
*
* @param field name of the field