diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-02-29 16:42:10 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-02-29 16:42:10 +0100 |
commit | 0a2b049864c8dae0c53c203d46fca89e0e66849d (patch) | |
tree | 3e836be37902320a4a3a099ee62d960198057952 /src/exchange | |
parent | de9ab28ab9e55597baf2ca32194ec65b441f0f36 (diff) | |
download | exchange-0a2b049864c8dae0c53c203d46fca89e0e66849d.tar.gz exchange-0a2b049864c8dae0c53c203d46fca89e0e66849d.tar.bz2 exchange-0a2b049864c8dae0c53c203d46fca89e0e66849d.zip |
big rename fest related to #6067 API renaming
Diffstat (limited to 'src/exchange')
-rw-r--r-- | src/exchange/Makefile.am | 6 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd.c | 6 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_link.c (renamed from src/exchange/taler-exchange-httpd_refresh_link.c) | 2 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_link.h (renamed from src/exchange/taler-exchange-httpd_refresh_link.h) | 0 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_melt.c (renamed from src/exchange/taler-exchange-httpd_refresh_melt.c) | 80 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_melt.h (renamed from src/exchange/taler-exchange-httpd_refresh_melt.h) | 4 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_refreshes_reveal.c (renamed from src/exchange/taler-exchange-httpd_refresh_reveal.c) | 36 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_refreshes_reveal.h (renamed from src/exchange/taler-exchange-httpd_refresh_reveal.h) | 0 |
8 files changed, 67 insertions, 67 deletions
diff --git a/src/exchange/Makefile.am b/src/exchange/Makefile.am index fe1fd397f..61d3341cc 100644 --- a/src/exchange/Makefile.am +++ b/src/exchange/Makefile.am @@ -51,11 +51,11 @@ taler_exchange_httpd_SOURCES = \ taler-exchange-httpd_deposit.c taler-exchange-httpd_deposit.h \ taler-exchange-httpd_deposits_get.c taler-exchange-httpd_deposits_get.h \ taler-exchange-httpd_keystate.c taler-exchange-httpd_keystate.h \ + taler-exchange-httpd_link.c taler-exchange-httpd_link.h \ taler-exchange-httpd_mhd.c taler-exchange-httpd_mhd.h \ taler-exchange-httpd_recoup.c taler-exchange-httpd_recoup.h \ - taler-exchange-httpd_refresh_link.c taler-exchange-httpd_refresh_link.h \ - taler-exchange-httpd_refresh_melt.c taler-exchange-httpd_refresh_melt.h \ - taler-exchange-httpd_refresh_reveal.c taler-exchange-httpd_refresh_reveal.h \ + taler-exchange-httpd_melt.c taler-exchange-httpd_melt.h \ + taler-exchange-httpd_refreshes_reveal.c taler-exchange-httpd_refreshes_reveal.h \ taler-exchange-httpd_refund.c taler-exchange-httpd_refund.h \ taler-exchange-httpd_reserves_get.c taler-exchange-httpd_reserves_get.h \ taler-exchange-httpd_responses.c taler-exchange-httpd_responses.h \ diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c index 8d5692967..d353a7965 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -33,9 +33,9 @@ #include "taler-exchange-httpd_reserves_get.h" #include "taler-exchange-httpd_withdraw.h" #include "taler-exchange-httpd_recoup.h" -#include "taler-exchange-httpd_refresh_link.h" -#include "taler-exchange-httpd_refresh_melt.h" -#include "taler-exchange-httpd_refresh_reveal.h" +#include "taler-exchange-httpd_link.h" +#include "taler-exchange-httpd_melt.h" +#include "taler-exchange-httpd_refreshes_reveal.h" #include "taler-exchange-httpd_terms.h" #include "taler-exchange-httpd_transfers_get.h" #include "taler-exchange-httpd_deposits_get.h" diff --git a/src/exchange/taler-exchange-httpd_refresh_link.c b/src/exchange/taler-exchange-httpd_link.c index 6dbaed497..83d7f6a05 100644 --- a/src/exchange/taler-exchange-httpd_refresh_link.c +++ b/src/exchange/taler-exchange-httpd_link.c @@ -26,7 +26,7 @@ #include <microhttpd.h> #include "taler_mhd_lib.h" #include "taler-exchange-httpd_mhd.h" -#include "taler-exchange-httpd_refresh_link.h" +#include "taler-exchange-httpd_link.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_keystate.h" diff --git a/src/exchange/taler-exchange-httpd_refresh_link.h b/src/exchange/taler-exchange-httpd_link.h index 9469c4713..9469c4713 100644 --- a/src/exchange/taler-exchange-httpd_refresh_link.h +++ b/src/exchange/taler-exchange-httpd_link.h diff --git a/src/exchange/taler-exchange-httpd_refresh_melt.c b/src/exchange/taler-exchange-httpd_melt.c index 9d92a4cee..035fc48f1 100644 --- a/src/exchange/taler-exchange-httpd_refresh_melt.c +++ b/src/exchange/taler-exchange-httpd_melt.c @@ -14,7 +14,7 @@ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ /** - * @file taler-exchange-httpd_refresh_melt.c + * @file taler-exchange-httpd_melt.c * @brief Handle /refresh/melt requests * @author Florian Dold * @author Benedikt Mueller @@ -27,7 +27,7 @@ #include "taler_json_lib.h" #include "taler_mhd_lib.h" #include "taler-exchange-httpd_mhd.h" -#include "taler-exchange-httpd_refresh_melt.h" +#include "taler-exchange-httpd_melt.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_keystate.h" @@ -48,14 +48,14 @@ * @return a MHD result code */ static int -reply_refresh_melt_insufficient_funds (struct MHD_Connection *connection, - const struct - TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_Amount *coin_value, - struct TALER_EXCHANGEDB_TransactionList * - tl, - const struct TALER_Amount *requested, - const struct TALER_Amount *residual) +reply_melt_insufficient_funds (struct MHD_Connection *connection, + const struct + TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_Amount *coin_value, + struct TALER_EXCHANGEDB_TransactionList * + tl, + const struct TALER_Amount *requested, + const struct TALER_Amount *residual) { json_t *history; @@ -96,9 +96,9 @@ reply_refresh_melt_insufficient_funds (struct MHD_Connection *connection, * @return a MHD status code */ static int -reply_refresh_melt_success (struct MHD_Connection *connection, - const struct TALER_RefreshCommitmentP *rc, - uint32_t noreveal_index) +reply_melt_success (struct MHD_Connection *connection, + const struct TALER_RefreshCommitmentP *rc, + uint32_t noreveal_index) { struct TALER_RefreshMeltConfirmationPS body; struct TALER_ExchangePublicKeyP pub; @@ -139,7 +139,7 @@ struct RefreshMeltContext /** * noreveal_index is only initialized during - * #refresh_melt_transaction(). + * #melt_transaction(). */ struct TALER_EXCHANGEDB_RefreshSession refresh_session; @@ -253,14 +253,14 @@ refresh_check_melt (struct MHD_Connection *connection, TALER_amount_subtract (&coin_residual, &spent, &rmc->refresh_session.amount_with_fee)); - *mhd_ret = reply_refresh_melt_insufficient_funds (connection, - &rmc->refresh_session.coin - .coin_pub, - &rmc->coin_value, - tl, - &rmc->refresh_session. - amount_with_fee, - &coin_residual); + *mhd_ret = reply_melt_insufficient_funds (connection, + &rmc->refresh_session.coin + .coin_pub, + &rmc->coin_value, + tl, + &rmc->refresh_session. + amount_with_fee, + &coin_residual); TEH_plugin->free_coin_transaction_list (TEH_plugin->cls, tl); return GNUNET_DB_STATUS_HARD_ERROR; @@ -294,10 +294,10 @@ refresh_check_melt (struct MHD_Connection *connection, * @return transaction status */ static enum GNUNET_DB_QueryStatus -refresh_melt_transaction (void *cls, - struct MHD_Connection *connection, - struct TALER_EXCHANGEDB_Session *session, - int *mhd_ret) +melt_transaction (void *cls, + struct MHD_Connection *connection, + struct TALER_EXCHANGEDB_Session *session, + int *mhd_ret) { struct RefreshMeltContext *rmc = cls; enum GNUNET_DB_QueryStatus qs; @@ -311,9 +311,9 @@ refresh_melt_transaction (void *cls, if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs) { TALER_LOG_DEBUG ("Found already-melted coin\n"); - *mhd_ret = reply_refresh_melt_success (connection, - &rmc->refresh_session.rc, - noreveal_index); + *mhd_ret = reply_melt_success (connection, + &rmc->refresh_session.rc, + noreveal_index); /* Note: we return "hard error" to ensure the wrapper does not retry the transaction, and to also not generate a "fresh" response (as we would on "success") */ @@ -366,15 +366,15 @@ refresh_melt_transaction (void *cls, * happened. We now need to validate the coins being melted and the * session signature and then hand things of to execute the melt * operation. This function parses the JSON arrays and then passes - * processing on to #refresh_melt_transaction(). + * processing on to #melt_transaction(). * * @param connection the MHD connection to handle * @param[in,out] rmc details about the melt request * @return MHD result code */ static int -handle_refresh_melt (struct MHD_Connection *connection, - struct RefreshMeltContext *rmc) +handle_melt (struct MHD_Connection *connection, + struct RefreshMeltContext *rmc) { /* verify signature of coin for melt operation */ @@ -415,15 +415,15 @@ handle_refresh_melt (struct MHD_Connection *connection, TEH_DB_run_transaction (connection, "run melt", &mhd_ret, - &refresh_melt_transaction, + &melt_transaction, rmc)) return mhd_ret; } /* generate ordinary response */ - return reply_refresh_melt_success (connection, - &rmc->refresh_session.rc, - rmc->refresh_session.noreveal_index); + return reply_melt_success (connection, + &rmc->refresh_session.rc, + rmc->refresh_session.noreveal_index); } @@ -571,8 +571,8 @@ check_for_denomination_key (struct MHD_Connection *connection, TALER_EC_REFRESH_MELT_FEES_EXCEED_CONTRIBUTION, "melt amount smaller than melting fee"); } - return handle_refresh_melt (connection, - rmc); + return handle_melt (connection, + rmc); } @@ -580,7 +580,7 @@ check_for_denomination_key (struct MHD_Connection *connection, * Handle a "/coins/$COIN_PUB/melt" request. Parses the request into the JSON * components and then hands things of to #check_for_denomination_key() to * validate the melted coins, the signature and execute the melt using - * handle_refresh_melt(). + * handle_melt(). * @param connection the MHD connection to handle * @param coin_pub public key of the coin @@ -625,4 +625,4 @@ TEH_REFRESH_handler_melt (struct MHD_Connection *connection, } -/* end of taler-exchange-httpd_refresh_melt.c */ +/* end of taler-exchange-httpd_melt.c */ diff --git a/src/exchange/taler-exchange-httpd_refresh_melt.h b/src/exchange/taler-exchange-httpd_melt.h index 41488c818..daf8ffc82 100644 --- a/src/exchange/taler-exchange-httpd_refresh_melt.h +++ b/src/exchange/taler-exchange-httpd_melt.h @@ -14,7 +14,7 @@ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ /** - * @file taler-exchange-httpd_refresh_melt.h + * @file taler-exchange-httpd_melt.h * @brief Handle /refresh/melt requests * @author Florian Dold * @author Benedikt Mueller @@ -32,7 +32,7 @@ * Handle a "/coins/$COIN_PUB/melt" request. Parses the request into the JSON * components and then hands things of to #check_for_denomination_key() to * validate the melted coins, the signature and execute the melt using - * handle_refresh_melt(). + * handle_melt(). * @param connection the MHD connection to handle * @param coin_pub public key of the coin diff --git a/src/exchange/taler-exchange-httpd_refresh_reveal.c b/src/exchange/taler-exchange-httpd_refreshes_reveal.c index 802f0a8a3..e7e5b97da 100644 --- a/src/exchange/taler-exchange-httpd_refresh_reveal.c +++ b/src/exchange/taler-exchange-httpd_refreshes_reveal.c @@ -14,8 +14,8 @@ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ /** - * @file taler-exchange-httpd_refresh_reveal.c - * @brief Handle /refresh/reveal requests + * @file taler-exchange-httpd_refreshes_reveal.c + * @brief Handle /refreshes/$RCH/reveal requests * @author Florian Dold * @author Benedikt Mueller * @author Christian Grothoff @@ -26,7 +26,7 @@ #include <microhttpd.h> #include "taler_mhd_lib.h" #include "taler-exchange-httpd_mhd.h" -#include "taler-exchange-httpd_refresh_reveal.h" +#include "taler-exchange-httpd_refreshes_reveal.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_keystate.h" @@ -299,7 +299,7 @@ refresh_reveal_transaction (void *cls, int *mhd_ret) { struct RevealContext *rctx = cls; - struct TALER_EXCHANGEDB_RefreshMelt refresh_melt; + struct TALER_EXCHANGEDB_RefreshMelt melt; enum GNUNET_DB_QueryStatus qs; /* Obtain basic information about the refresh operation and what @@ -307,7 +307,7 @@ refresh_reveal_transaction (void *cls, qs = TEH_plugin->get_melt (TEH_plugin->cls, session, &rctx->rc, - &refresh_melt); + &melt); if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) { *mhd_ret = TALER_MHD_reply_with_error (connection, @@ -319,7 +319,7 @@ refresh_reveal_transaction (void *cls, if (GNUNET_DB_STATUS_SOFT_ERROR == qs) return qs; if ( (GNUNET_DB_STATUS_HARD_ERROR == qs) || - (refresh_melt.session.noreveal_index >= TALER_CNC_KAPPA) ) + (melt.session.noreveal_index >= TALER_CNC_KAPPA) ) { GNUNET_break (0); *mhd_ret = TALER_MHD_reply_with_error (connection, @@ -331,7 +331,7 @@ refresh_reveal_transaction (void *cls, /* Verify commitment */ { - /* Note that the contents of rcs[refresh_melt.session.noreveal_index] + /* Note that the contents of rcs[melt.session.noreveal_index] will be aliased and are *not* allocated (or deallocated) in this function -- in contrast to the other offsets! */ struct TALER_RefreshCommitmentEntry rcs[TALER_CNC_KAPPA]; @@ -343,7 +343,7 @@ refresh_reveal_transaction (void *cls, { struct TALER_RefreshCommitmentEntry *rce = &rcs[i]; - if (i == refresh_melt.session.noreveal_index) + if (i == melt.session.noreveal_index) { /* Take these coin envelopes from the client */ rce->transfer_pub = rctx->gamma_tp; @@ -360,7 +360,7 @@ refresh_reveal_transaction (void *cls, GNUNET_CRYPTO_ecdhe_key_get_public (&tpriv->ecdhe_priv, &rce->transfer_pub.ecdhe_pub); TALER_link_reveal_transfer_secret (tpriv, - &refresh_melt.session.coin.coin_pub, + &melt.session.coin.coin_pub, &ts); rce->new_coins = GNUNET_new_array (rctx->num_fresh_coins, struct TALER_RefreshCoinData); @@ -387,15 +387,15 @@ refresh_reveal_transaction (void *cls, TALER_CNC_KAPPA, rctx->num_fresh_coins, rcs, - &refresh_melt.session.coin.coin_pub, - &refresh_melt.session.amount_with_fee); + &melt.session.coin.coin_pub, + &melt.session.amount_with_fee); /* Free resources allocated above */ for (unsigned int i = 0; i<TALER_CNC_KAPPA; i++) { struct TALER_RefreshCommitmentEntry *rce = &rcs[i]; - if (i == refresh_melt.session.noreveal_index) + if (i == melt.session.noreveal_index) continue; /* This offset is special... */ for (unsigned int j = 0; j<rctx->num_fresh_coins; j++) { @@ -421,7 +421,7 @@ refresh_reveal_transaction (void *cls, { struct TALER_Amount refresh_cost; - refresh_cost = refresh_melt.melt_fee; + refresh_cost = melt.melt_fee; for (unsigned int i = 0; i<rctx->num_fresh_coins; i++) { struct TALER_Amount fee_withdraw; @@ -450,7 +450,7 @@ refresh_reveal_transaction (void *cls, } } if (0 < TALER_amount_cmp (&refresh_cost, - &refresh_melt.session.amount_with_fee)) + &melt.session.amount_with_fee)) { GNUNET_break_op (0); *mhd_ret = TALER_MHD_reply_with_error (connection, @@ -542,7 +542,7 @@ resolve_refresh_reveal_denominations (struct TEH_KS_StateHandle *key_state, struct GNUNET_HashCode dki_h[num_fresh_coins]; struct TALER_RefreshCoinData rcds[num_fresh_coins]; struct TALER_CoinSpendSignatureP link_sigs[num_fresh_coins]; - struct TALER_EXCHANGEDB_RefreshMelt refresh_melt; + struct TALER_EXCHANGEDB_RefreshMelt melt; int res; /* Parse denomination key hashes */ @@ -613,7 +613,7 @@ resolve_refresh_reveal_denominations (struct TEH_KS_StateHandle *key_state, (qs = TEH_plugin->get_melt (TEH_plugin->cls, NULL, &rctx->rc, - &refresh_melt))) + &melt))) { switch (qs) { @@ -663,7 +663,7 @@ resolve_refresh_reveal_denominations (struct TEH_KS_StateHandle *key_state, ldp.purpose.size = htonl (sizeof (ldp)); ldp.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_LINK); ldp.h_denom_pub = dki_h[i]; - ldp.old_coin_pub = refresh_melt.session.coin.coin_pub; + ldp.old_coin_pub = melt.session.coin.coin_pub; ldp.transfer_pub = rctx->gamma_tp; GNUNET_CRYPTO_hash (rcds[i].coin_ev, rcds[i].coin_ev_size, @@ -672,7 +672,7 @@ resolve_refresh_reveal_denominations (struct TEH_KS_StateHandle *key_state, GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_LINK, &ldp.purpose, &link_sigs[i].eddsa_signature, - &refresh_melt.session.coin.coin_pub. + &melt.session.coin.coin_pub. eddsa_pub)) { GNUNET_break_op (0); diff --git a/src/exchange/taler-exchange-httpd_refresh_reveal.h b/src/exchange/taler-exchange-httpd_refreshes_reveal.h index afc9adce5..afc9adce5 100644 --- a/src/exchange/taler-exchange-httpd_refresh_reveal.h +++ b/src/exchange/taler-exchange-httpd_refreshes_reveal.h |