diff options
Diffstat (limited to 'src/lib/exchange_api_refreshes_reveal.c')
-rw-r--r-- | src/lib/exchange_api_refreshes_reveal.c | 58 |
1 files changed, 12 insertions, 46 deletions
diff --git a/src/lib/exchange_api_refreshes_reveal.c b/src/lib/exchange_api_refreshes_reveal.c index d0ca605ac..f54487ae3 100644 --- a/src/lib/exchange_api_refreshes_reveal.c +++ b/src/lib/exchange_api_refreshes_reveal.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of TALER | 2 | This file is part of TALER |
3 | Copyright (C) 2015-2020 Taler Systems SA | 3 | Copyright (C) 2015-2021 Taler Systems SA |
4 | 4 | ||
5 | TALER is free software; you can redistribute it and/or modify it under the | 5 | TALER is free software; you can redistribute it and/or modify it under the |
6 | terms of the GNU General Public License as published by the Free Software | 6 | terms of the GNU General Public License as published by the Free Software |
@@ -287,28 +287,6 @@ handle_refresh_reveal_finished (void *cls, | |||
287 | } | 287 | } |
288 | 288 | ||
289 | 289 | ||
290 | /** | ||
291 | * Submit a /refresh/reval request to the exchange and get the exchange's | ||
292 | * response. | ||
293 | * | ||
294 | * This API is typically used by a wallet. Note that to ensure that | ||
295 | * no money is lost in case of hardware failures, the provided | ||
296 | * arguments should have been committed to persistent storage | ||
297 | * prior to calling this function. | ||
298 | * | ||
299 | * @param exchange the exchange handle; the exchange must be ready to operate | ||
300 | * @param refresh_data_length size of the @a refresh_data (returned | ||
301 | * in the `res_size` argument from #TALER_EXCHANGE_refresh_prepare()) | ||
302 | * @param refresh_data the refresh data as returned from | ||
303 | #TALER_EXCHANGE_refresh_prepare()) | ||
304 | * @param noreveal_index response from the exchange to the | ||
305 | * #TALER_EXCHANGE_melt() invocation | ||
306 | * @param reveal_cb the callback to call with the final result of the | ||
307 | * refresh operation | ||
308 | * @param reveal_cb_cls closure for the above callback | ||
309 | * @return a handle for this request; NULL if the argument was invalid. | ||
310 | * In this case, neither callback will be called. | ||
311 | */ | ||
312 | struct TALER_EXCHANGE_RefreshesRevealHandle * | 290 | struct TALER_EXCHANGE_RefreshesRevealHandle * |
313 | TALER_EXCHANGE_refreshes_reveal ( | 291 | TALER_EXCHANGE_refreshes_reveal ( |
314 | struct TALER_EXCHANGE_Handle *exchange, | 292 | struct TALER_EXCHANGE_Handle *exchange, |
@@ -425,23 +403,17 @@ TALER_EXCHANGE_refreshes_reveal ( | |||
425 | } | 403 | } |
426 | 404 | ||
427 | /* build main JSON request */ | 405 | /* build main JSON request */ |
428 | reveal_obj = json_pack ("{s:o, s:o, s:o, s:o, s:o}", | 406 | reveal_obj = GNUNET_JSON_PACK ( |
429 | "transfer_pub", | 407 | GNUNET_JSON_pack_data_auto ("transfer_pub", |
430 | GNUNET_JSON_from_data_auto (&transfer_pub), | 408 | &transfer_pub), |
431 | "transfer_privs", | 409 | GNUNET_JSON_pack_array_steal ("transfer_privs", |
432 | transfer_privs, | 410 | transfer_privs), |
433 | "link_sigs", | 411 | GNUNET_JSON_pack_array_steal ("link_sigs", |
434 | link_sigs, | 412 | link_sigs), |
435 | "new_denoms_h", | 413 | GNUNET_JSON_pack_array_steal ("new_denoms_h", |
436 | new_denoms_h, | 414 | new_denoms_h), |
437 | "coin_evs", | 415 | GNUNET_JSON_pack_array_steal ("coin_evs", |
438 | coin_evs); | 416 | coin_evs)); |
439 | if (NULL == reveal_obj) | ||
440 | { | ||
441 | GNUNET_break (0); | ||
442 | return NULL; | ||
443 | } | ||
444 | |||
445 | { | 417 | { |
446 | char pub_str[sizeof (struct TALER_RefreshCommitmentP) * 2]; | 418 | char pub_str[sizeof (struct TALER_RefreshCommitmentP) * 2]; |
447 | char *end; | 419 | char *end; |
@@ -498,12 +470,6 @@ TALER_EXCHANGE_refreshes_reveal ( | |||
498 | } | 470 | } |
499 | 471 | ||
500 | 472 | ||
501 | /** | ||
502 | * Cancel a refresh reveal request. This function cannot be used | ||
503 | * on a request handle if the callback was already invoked. | ||
504 | * | ||
505 | * @param rrh the refresh reval handle | ||
506 | */ | ||
507 | void | 473 | void |
508 | TALER_EXCHANGE_refreshes_reveal_cancel ( | 474 | TALER_EXCHANGE_refreshes_reveal_cancel ( |
509 | struct TALER_EXCHANGE_RefreshesRevealHandle *rrh) | 475 | struct TALER_EXCHANGE_RefreshesRevealHandle *rrh) |