From dc691eb596b61bbf26d9b38cf245c1188f056f51 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 29 Jun 2022 14:08:19 +0200 Subject: -rename, as logic is purse deposit specific --- src/exchange/taler-exchange-httpd_common_deposit.c | 8 +++---- src/exchange/taler-exchange-httpd_common_deposit.h | 10 ++++---- src/exchange/taler-exchange-httpd_purses_create.c | 28 +++++++++++----------- src/exchange/taler-exchange-httpd_purses_deposit.c | 24 +++++++++---------- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/exchange/taler-exchange-httpd_common_deposit.c b/src/exchange/taler-exchange-httpd_common_deposit.c index b6959cc9a..cfa15fccb 100644 --- a/src/exchange/taler-exchange-httpd_common_deposit.c +++ b/src/exchange/taler-exchange-httpd_common_deposit.c @@ -25,9 +25,9 @@ enum GNUNET_GenericReturnValue -TEH_common_deposit_parse_coin ( +TEH_common_purse_deposit_parse_coin ( struct MHD_Connection *connection, - struct TEH_DepositedCoin *coin, + struct TEH_PurseDepositedCoin *coin, const json_t *jcoin) { struct GNUNET_JSON_Specification spec[] = { @@ -194,7 +194,7 @@ TEH_common_deposit_parse_coin ( enum GNUNET_GenericReturnValue TEH_common_deposit_check_purse_deposit ( struct MHD_Connection *connection, - const struct TEH_DepositedCoin *coin, + const struct TEH_PurseDepositedCoin *coin, const struct TALER_PurseContractPublicKeyP *purse_pub, uint32_t min_age) { @@ -255,7 +255,7 @@ TEH_common_deposit_check_purse_deposit ( * @param[in] coin information to release */ void -TEH_common_deposit_free_coin (struct TEH_DepositedCoin *coin) +TEH_common_purse_deposit_free_coin (struct TEH_PurseDepositedCoin *coin) { TALER_denom_sig_free (&coin->cpi.denom_sig); if (! coin->cpi.no_age_commitment) diff --git a/src/exchange/taler-exchange-httpd_common_deposit.h b/src/exchange/taler-exchange-httpd_common_deposit.h index d6940c5db..10fd7e8bf 100644 --- a/src/exchange/taler-exchange-httpd_common_deposit.h +++ b/src/exchange/taler-exchange-httpd_common_deposit.h @@ -32,7 +32,7 @@ /** * Information about an individual coin being deposited. */ -struct TEH_DepositedCoin +struct TEH_PurseDepositedCoin { /** * Public information about the coin. @@ -93,9 +93,9 @@ struct TEH_DepositedCoin * #GNUNET_SYSERR on failure and no error could be returned */ enum GNUNET_GenericReturnValue -TEH_common_deposit_parse_coin ( +TEH_common_purse_deposit_parse_coin ( struct MHD_Connection *connection, - struct TEH_DepositedCoin *coin, + struct TEH_PurseDepositedCoin *coin, const json_t *jcoin); @@ -113,7 +113,7 @@ TEH_common_deposit_parse_coin ( enum GNUNET_GenericReturnValue TEH_common_deposit_check_purse_deposit ( struct MHD_Connection *connection, - const struct TEH_DepositedCoin *coin, + const struct TEH_PurseDepositedCoin *coin, const struct TALER_PurseContractPublicKeyP *purse_pub, uint32_t min_age); @@ -125,6 +125,6 @@ TEH_common_deposit_check_purse_deposit ( * @param[in] coin information to release */ void -TEH_common_deposit_free_coin (struct TEH_DepositedCoin *coin); +TEH_common_purse_deposit_free_coin (struct TEH_PurseDepositedCoin *coin); #endif diff --git a/src/exchange/taler-exchange-httpd_purses_create.c b/src/exchange/taler-exchange-httpd_purses_create.c index ba827428a..b6eea05fa 100644 --- a/src/exchange/taler-exchange-httpd_purses_create.c +++ b/src/exchange/taler-exchange-httpd_purses_create.c @@ -87,7 +87,7 @@ struct PurseCreateContext /** * Array of coins being deposited. */ - struct TEH_DepositedCoin *coins; + struct TEH_PurseDepositedCoin *coins; /** * Length of the @e coins array. @@ -258,7 +258,7 @@ create_transaction (void *cls, /* 2) deposit all coins */ for (unsigned int i = 0; inum_coins; i++) { - struct TEH_DepositedCoin *coin = &pcc->coins[i]; + struct TEH_PurseDepositedCoin *coin = &pcc->coins[i]; bool balance_ok = false; bool conflict = true; @@ -430,15 +430,15 @@ create_transaction (void *cls, static enum GNUNET_GenericReturnValue parse_coin (struct MHD_Connection *connection, struct PurseCreateContext *pcc, - struct TEH_DepositedCoin *coin, + struct TEH_PurseDepositedCoin *coin, const json_t *jcoin) { enum GNUNET_GenericReturnValue iret; if (GNUNET_OK != - (iret = TEH_common_deposit_parse_coin (connection, - coin, - jcoin))) + (iret = TEH_common_purse_deposit_parse_coin (connection, + coin, + jcoin))) return iret; if (GNUNET_OK != (iret = TEH_common_deposit_check_purse_deposit ( @@ -580,11 +580,11 @@ TEH_handler_purses_create ( } /* parse deposits */ pcc.coins = GNUNET_new_array (pcc.num_coins, - struct TEH_DepositedCoin); + struct TEH_PurseDepositedCoin); json_array_foreach (deposits, idx, deposit) { enum GNUNET_GenericReturnValue res; - struct TEH_DepositedCoin *coin = &pcc.coins[idx]; + struct TEH_PurseDepositedCoin *coin = &pcc.coins[idx]; res = parse_coin (connection, &pcc, @@ -594,7 +594,7 @@ TEH_handler_purses_create ( { GNUNET_JSON_parse_free (spec); for (unsigned int i = 0; inum_coins; i++) { - struct TEH_DepositedCoin *coin = &pcc->coins[i]; + struct TEH_PurseDepositedCoin *coin = &pcc->coins[i]; bool balance_ok = false; bool conflict = true; @@ -274,15 +274,15 @@ deposit_transaction (void *cls, static enum GNUNET_GenericReturnValue parse_coin (struct MHD_Connection *connection, struct PurseDepositContext *pcc, - struct TEH_DepositedCoin *coin, + struct TEH_PurseDepositedCoin *coin, const json_t *jcoin) { enum GNUNET_GenericReturnValue iret; if (GNUNET_OK != - (iret = TEH_common_deposit_parse_coin (connection, - coin, - jcoin))) + (iret = TEH_common_purse_deposit_parse_coin (connection, + coin, + jcoin))) return iret; if (GNUNET_OK != (iret = TEH_common_deposit_check_purse_deposit ( @@ -402,11 +402,11 @@ TEH_handler_purses_deposit ( /* parse deposits */ pcc.coins = GNUNET_new_array (pcc.num_coins, - struct TEH_DepositedCoin); + struct TEH_PurseDepositedCoin); json_array_foreach (deposits, idx, deposit) { enum GNUNET_GenericReturnValue res; - struct TEH_DepositedCoin *coin = &pcc.coins[idx]; + struct TEH_PurseDepositedCoin *coin = &pcc.coins[idx]; res = parse_coin (connection, &pcc, @@ -416,7 +416,7 @@ TEH_handler_purses_deposit ( { GNUNET_JSON_parse_free (spec); for (unsigned int i = 0; i