From 40629e89920267dadba39f5f7f2ab3d844088a0e Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Mon, 3 Jul 2023 16:18:40 +0200 Subject: [age-withdraw] added library function for age-withdraw - Added TALER_EXCHANGE_age_withdraw - Also: Change TALER_EXCHANGE_batch_withdraw and related functions to use GNUNET_CURL_ctx, TALER_EXCHANGE_keys and const char *echange_url --- src/lib/exchange_api_batch_withdraw.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'src/lib/exchange_api_batch_withdraw.c') diff --git a/src/lib/exchange_api_batch_withdraw.c b/src/lib/exchange_api_batch_withdraw.c index 4817ae40..07ad37f6 100644 --- a/src/lib/exchange_api_batch_withdraw.c +++ b/src/lib/exchange_api_batch_withdraw.c @@ -97,9 +97,20 @@ struct TALER_EXCHANGE_BatchWithdrawHandle { /** - * The connection to exchange this request handle will use + * The curl context to use */ - struct TALER_EXCHANGE_Handle *exchange; + struct GNUNET_CURL_Context *curl_ctx; + + /** + * The base URL to the exchange + */ + const char *exchange_url; + + /** + * The /keys information from the exchange + */ + const struct TALER_EXCHANGE_Keys *keys; + /** * Handle for the actual (internal) batch withdraw operation. @@ -255,7 +266,9 @@ phase_two (struct TALER_EXCHANGE_BatchWithdrawHandle *wh) pds[i] = cd->pd; } wh->wh2 = TALER_EXCHANGE_batch_withdraw2 ( - wh->exchange, + wh->curl_ctx, + wh->exchange_url, + wh->keys, wh->reserve_priv, pds, wh->num_coins, @@ -322,7 +335,9 @@ withdraw_cs_stage_two_callback ( struct TALER_EXCHANGE_BatchWithdrawHandle * TALER_EXCHANGE_batch_withdraw ( - struct TALER_EXCHANGE_Handle *exchange, + struct GNUNET_CURL_Context *curl_ctx, + const char *exchange_url, + const struct TALER_EXCHANGE_Keys *keys, const struct TALER_ReservePrivateKeyP *reserve_priv, const struct TALER_EXCHANGE_WithdrawCoinInput *wcis, unsigned int wci_length, @@ -332,7 +347,9 @@ TALER_EXCHANGE_batch_withdraw ( struct TALER_EXCHANGE_BatchWithdrawHandle *wh; wh = GNUNET_new (struct TALER_EXCHANGE_BatchWithdrawHandle); - wh->exchange = exchange; + wh->curl_ctx = curl_ctx; + wh->exchange_url = exchange_url; + wh->keys = keys; wh->cb = res_cb; wh->cb_cls = res_cb_cls; wh->reserve_priv = reserve_priv; @@ -386,7 +403,8 @@ TALER_EXCHANGE_batch_withdraw ( will be done after the /csr-withdraw request! */ cd->pd.blinded_planchet.cipher = TALER_DENOMINATION_CS; cd->csrh = TALER_EXCHANGE_csr_withdraw ( - exchange, + curl_ctx, + exchange_url, &cd->pk, &cd->pd.blinded_planchet.details.cs_blinded_planchet.nonce, &withdraw_cs_stage_two_callback, -- cgit v1.2.3