diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-01 16:15:35 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-01 16:15:35 +0200 |
commit | de3e26303e0069614d4a5aa425e4fa5ddb088b8b (patch) | |
tree | 982ba3095d80ec48a910dad15e3d886b36c6be24 /src/exchange/taler-exchange-httpd_validation.c | |
parent | 92907bee45681b1273172a3c88461a60bcae8589 (diff) | |
download | exchange-de3e26303e0069614d4a5aa425e4fa5ddb088b8b.tar.gz exchange-de3e26303e0069614d4a5aa425e4fa5ddb088b8b.tar.bz2 exchange-de3e26303e0069614d4a5aa425e4fa5ddb088b8b.zip |
implementing #4356, tests still failing, but main logic should now be updated
Diffstat (limited to 'src/exchange/taler-exchange-httpd_validation.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_validation.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/exchange/taler-exchange-httpd_validation.c b/src/exchange/taler-exchange-httpd_validation.c index b7e8a7f80..0b72960c5 100644 --- a/src/exchange/taler-exchange-httpd_validation.c +++ b/src/exchange/taler-exchange-httpd_validation.c @@ -200,33 +200,39 @@ TMH_VALIDATION_test_method (const char *type) /** - * Obtain supported validation methods as a JSON array, - * and as a hash. + * Obtain JSON of the supported wire methods for a given + * account name prefix. * - * @param[out] h set to the hash of the JSON methods + * @param prefix prefix for the account, the suffix will + * be determined by the name of the plugin * @return JSON array with the supported validation methods */ json_t * -TMH_VALIDATION_get_methods (struct GNUNET_HashCode *h) +TMH_VALIDATION_get_wire_methods (const char *prefix) { json_t *methods; - struct GNUNET_HashContext *hc; - const char *wf; + json_t *method; struct Plugin *p; + struct TALER_WIRE_Plugin *plugin; + char *account_name; - methods = json_array (); - hc = GNUNET_CRYPTO_hash_context_start (); + methods = json_object (); for (p=wire_head;NULL != p;p = p->next) { - wf = p->type; - json_array_append_new (methods, - json_string (wf)); - GNUNET_CRYPTO_hash_context_read (hc, - wf, - strlen (wf) + 1); + plugin = p->plugin; + GNUNET_asprintf (&account_name, + "%s-%s\n", + prefix, + p->type); + method = plugin->get_wire_details (plugin->cls, + cfg, + account_name); + if (NULL != method) + json_object_set_new (methods, + p->type, + method); + GNUNET_free (account_name); } - GNUNET_CRYPTO_hash_context_finish (hc, - h); return methods; } |