From e8a892c29aed9b08f800878ad4d6e789f9571b64 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 23 Jul 2019 21:56:21 +0200 Subject: modify /payback API and test usage of that API to pass/return additional information required when dealing with payback of refreshed coins --- src/include/taler_exchange_service.h | 6 +++++- src/include/taler_testing_lib.h | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/include') diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 7fc7a5690..7bcfee9e4 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -1651,7 +1651,8 @@ struct TALER_EXCHANGE_PaybackHandle; * @param amount amount the exchange will wire back for this coin, * on error the total balance remaining, or NULL * @param timestamp what time did the exchange receive the /payback request - * @param reserve_pub public key of the reserve receiving the payback + * @param reserve_pub public key of the reserve receiving the payback, NULL if refreshed or on error + * @param old_coin_pub public key of the dirty coin, NULL if not refreshed or on error * @param full_response full response from the exchange (for logging, in case of errors) */ typedef void @@ -1661,6 +1662,7 @@ typedef void const struct TALER_Amount *amount, struct GNUNET_TIME_Absolute timestamp, const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_CoinSpendPublicKeyP *old_coin_pub, const json_t *full_response); @@ -1673,6 +1675,7 @@ typedef void * @param pk kind of coin to pay back * @param denom_sig signature over the coin by the exchange using @a pk * @param ps secret internals of the original planchet + * @param was_refreshed #GNUNET_YES if the coin in @a ps was refreshed * @param payback_cb the callback to call when the final result for this request is available * @param payback_cb_cls closure for @a payback_cb * @return NULL @@ -1684,6 +1687,7 @@ TALER_EXCHANGE_payback (struct TALER_EXCHANGE_Handle *exchange, const struct TALER_EXCHANGE_DenomPublicKey *pk, const struct TALER_DenominationSignature *denom_sig, const struct TALER_PlanchetSecretsP *ps, + int was_refreshed, TALER_EXCHANGE_PaybackResultCallback payback_cb, void *payback_cb_cls); diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index beb28f7a0..c08cfdc5c 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -1388,14 +1388,15 @@ TALER_TESTING_cmd_refund (const char *label, * the index of the coin using "$LABEL#$INDEX" syntax. * Here, $INDEX must be a non-negative number. * @param amount denomination to pay back. - * + * @param NULL if coin was not refreshed, otherwise label of the melt operation * @return the command. */ struct TALER_TESTING_Command TALER_TESTING_cmd_payback (const char *label, unsigned int expected_response_code, const char *coin_reference, - const char *amount); + const char *amount, + const char *melt_reference); /** @@ -1406,7 +1407,6 @@ TALER_TESTING_cmd_payback (const char *label, * @param coin_reference reference to a CMD that will offer the * denomination to revoke. * @param config_filename configuration file name. - * * @return the command. */ struct TALER_TESTING_Command -- cgit v1.2.3