diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2023-12-06 19:16:05 +0900 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2023-12-06 19:16:05 +0900 |
commit | 70035b1683e70cd09bbb43d7736139a72fed0b5a (patch) | |
tree | d4edbe46a1db8f96bc8904eeb7cd6d8c2301b2bc | |
parent | 4b4b0b9c48cb501e0afbe2e940135675f5d615a6 (diff) |
expand fakebank /config to return currency spec and other new fields
-rw-r--r-- | src/bank-lib/fakebank_tbi.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/bank-lib/fakebank_tbi.c b/src/bank-lib/fakebank_tbi.c index 27b930d9f..95e3a8c2e 100644 --- a/src/bank-lib/fakebank_tbi.c +++ b/src/bank-lib/fakebank_tbi.c @@ -49,6 +49,11 @@ TALER_FAKEBANK_tbi_main_ (struct TALER_FAKEBANK_Handle *h, (0 == strcasecmp (method, MHD_HTTP_METHOD_GET)) ) { + struct TALER_Amount zero; + + GNUNET_assert (GNUNET_OK == + TALER_amount_set_zero (h->currency, + &zero)); return TALER_MHD_REPLY_JSON_PACK ( connection, MHD_HTTP_OK, @@ -56,6 +61,40 @@ TALER_FAKEBANK_tbi_main_ (struct TALER_FAKEBANK_Handle *h, "0:0:0"), GNUNET_JSON_pack_string ("currency", h->currency), + GNUNET_JSON_pack_bool ("allow_conversion", + false), + GNUNET_JSON_pack_bool ("allow_registrations", + true), + GNUNET_JSON_pack_bool ("allow_deletions", + false), + GNUNET_JSON_pack_bool ("allow_edit_name", + false), + GNUNET_JSON_pack_bool ("allow_edit_cashout_payto_uri", + false), + TALER_JSON_pack_amount ("default_debit_threshold", + &zero), + GNUNET_JSON_pack_array_steal ("supported_tan_channels", + json_array ()), + GNUNET_JSON_pack_object_steal ( + "currency_specification", + GNUNET_JSON_PACK ( + GNUNET_JSON_pack_string ("name", + h->currency), + GNUNET_JSON_pack_string ("currency", + h->currency), + GNUNET_JSON_pack_uint64 ("num_fractional_input_digits", + 2), + GNUNET_JSON_pack_uint64 ("num_fractional_normal_digits", + 2), + GNUNET_JSON_pack_uint64 ("num_fractional_trailing_zero_digits", + 2), + GNUNET_JSON_pack_object_steal ( + "alt_unit_names", + GNUNET_JSON_PACK ( + GNUNET_JSON_pack_string ("0", + h->currency))), + GNUNET_JSON_pack_string ("name", + h->currency))), GNUNET_JSON_pack_string ("name", "taler-bank-integration")); } |