aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_link.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-06-22 22:05:34 +0200
committerChristian Grothoff <christian@grothoff.org>2023-06-22 22:05:34 +0200
commit720783b66a08a14624f30e8063daf64d25ce3e4c (patch)
tree24ae1feb57b363e18f279f9907e2b8cd37f87a62 /src/lib/exchange_api_link.c
parent999dae7c5d0c37473e486fa38816a3f35c42dba9 (diff)
downloadexchange-720783b66a08a14624f30e8063daf64d25ce3e4c.tar.xz
-more exchange API atomization
Diffstat (limited to 'src/lib/exchange_api_link.c')
-rw-r--r--src/lib/exchange_api_link.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/lib/exchange_api_link.c b/src/lib/exchange_api_link.c
index cc65b0dd3..04beeb296 100644
--- a/src/lib/exchange_api_link.c
+++ b/src/lib/exchange_api_link.c
@@ -447,7 +447,8 @@ handle_link_finished (void *cls,
struct TALER_EXCHANGE_LinkHandle *
TALER_EXCHANGE_link (
- struct TALER_EXCHANGE_Handle *exchange,
+ struct GNUNET_CURL_Context *ctx,
+ const char *url,
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
const struct TALER_AgeCommitmentProof *age_commitment_proof,
TALER_EXCHANGE_LinkCallback link_cb,
@@ -455,17 +456,9 @@ TALER_EXCHANGE_link (
{
struct TALER_EXCHANGE_LinkHandle *lh;
CURL *eh;
- struct GNUNET_CURL_Context *ctx;
struct TALER_CoinSpendPublicKeyP coin_pub;
char arg_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2 + 32];
- if (GNUNET_YES !=
- TEAH_handle_is_ready (exchange))
- {
- GNUNET_break (0);
- return NULL;
- }
-
GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv,
&coin_pub.eddsa_pub);
{
@@ -480,7 +473,7 @@ TALER_EXCHANGE_link (
*end = '\0';
GNUNET_snprintf (arg_str,
sizeof (arg_str),
- "/coins/%s/link",
+ "coins/%s/link",
pub_str);
}
lh = GNUNET_new (struct TALER_EXCHANGE_LinkHandle);
@@ -488,8 +481,9 @@ TALER_EXCHANGE_link (
lh->link_cb_cls = link_cb_cls;
lh->coin_priv = *coin_priv;
lh->age_commitment_proof = age_commitment_proof;
- lh->url = TEAH_path_to_url (exchange,
- arg_str);
+ lh->url = TALER_url_join (url,
+ arg_str,
+ NULL);
if (NULL == lh->url)
{
GNUNET_free (lh);
@@ -503,7 +497,6 @@ TALER_EXCHANGE_link (
GNUNET_free (lh);
return NULL;
}
- ctx = TEAH_handle_to_context (exchange);
lh->job = GNUNET_CURL_job_add_with_ct_json (ctx,
eh,
&handle_link_finished,