exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 2ccdc71e12f63ec7fcfbc13fba013f8544f045bb
parent 9935cbc3fbce43da38bc6188fce8c5a7ed2a821d
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Sat, 11 Jul 2026 19:29:13 +0200

check range first

Diffstat:
Msrc/testing/testing_api_cmd_batch_withdraw.c | 99+++++++++++++++++++++++++++++++++++++++++--------------------------------------
1 file changed, 52 insertions(+), 47 deletions(-)

diff --git a/src/testing/testing_api_cmd_batch_withdraw.c b/src/testing/testing_api_cmd_batch_withdraw.c @@ -434,56 +434,61 @@ batch_withdraw_traits (void *cls, unsigned int index) { struct BatchWithdrawState *ws = cls; - struct CoinState *cs = &ws->coins[index]; - struct TALER_TESTING_Trait traits[] = { - /* history entry MUST be first due to response code logic below! */ - TALER_TESTING_make_trait_reserve_history (index, - &ws->reserve_history), - TALER_TESTING_make_trait_coin_priv (index, - &cs->details.coin_priv), - TALER_TESTING_make_trait_coin_pub (index, - &cs->details.coin_pub), - TALER_TESTING_make_trait_planchet_secrets (index, - &cs->secret), - TALER_TESTING_make_trait_blinding_key (index, - &cs->details.blinding_key), - TALER_TESTING_make_trait_exchange_blinding_values (index, - &cs->details. - blinding_values), - TALER_TESTING_make_trait_denom_pub (index, - cs->pk), - TALER_TESTING_make_trait_denom_sig (index, - &cs->details.denom_sig), - TALER_TESTING_make_trait_withdraw_seed (&ws->seed), - TALER_TESTING_make_trait_withdraw_commitment (&ws->planchets_h), - TALER_TESTING_make_trait_reserve_priv (&ws->reserve_priv), - TALER_TESTING_make_trait_reserve_pub (&ws->reserve_pub), - TALER_TESTING_make_trait_amounts (index, - &cs->amount), - TALER_TESTING_make_trait_legi_requirement_row (&ws->requirement_row), - TALER_TESTING_make_trait_h_normalized_payto (&ws->h_payto), - TALER_TESTING_make_trait_normalized_payto_uri (&ws->reserve_payto_uri), - TALER_TESTING_make_trait_exchange_url (ws->exchange_url), - TALER_TESTING_make_trait_age_commitment_proof (index, - ws->age > 0 ? - &cs->details. - age_commitment_proof: - NULL), - TALER_TESTING_make_trait_h_age_commitment (index, - ws->age > 0 ? - &cs->details.h_age_commitment : - NULL), - TALER_TESTING_trait_end () - }; if (index >= ws->num_coins) return GNUNET_NO; - return TALER_TESTING_get_trait ((ws->expected_response_code == MHD_HTTP_OK) - ? &traits[0] /* we have reserve history */ - : &traits[1], /* skip reserve history */ - ret, - trait, - index); + { + struct CoinState *cs = &ws->coins[index]; + struct TALER_TESTING_Trait traits[] = { + /* history entry MUST be first due to response code logic below! */ + TALER_TESTING_make_trait_reserve_history (index, + &ws->reserve_history), + TALER_TESTING_make_trait_coin_priv (index, + &cs->details.coin_priv), + TALER_TESTING_make_trait_coin_pub (index, + &cs->details.coin_pub), + TALER_TESTING_make_trait_planchet_secrets (index, + &cs->secret), + TALER_TESTING_make_trait_blinding_key (index, + &cs->details.blinding_key), + TALER_TESTING_make_trait_exchange_blinding_values (index, + &cs->details. + blinding_values), + TALER_TESTING_make_trait_denom_pub (index, + cs->pk), + TALER_TESTING_make_trait_denom_sig (index, + &cs->details.denom_sig), + TALER_TESTING_make_trait_withdraw_seed (&ws->seed), + TALER_TESTING_make_trait_withdraw_commitment (&ws->planchets_h), + TALER_TESTING_make_trait_reserve_priv (&ws->reserve_priv), + TALER_TESTING_make_trait_reserve_pub (&ws->reserve_pub), + TALER_TESTING_make_trait_amounts (index, + &cs->amount), + TALER_TESTING_make_trait_legi_requirement_row (&ws->requirement_row), + TALER_TESTING_make_trait_h_normalized_payto (&ws->h_payto), + TALER_TESTING_make_trait_normalized_payto_uri (&ws->reserve_payto_uri), + TALER_TESTING_make_trait_exchange_url (ws->exchange_url), + TALER_TESTING_make_trait_age_commitment_proof ( + index, + ws->age > 0 + ? &cs->details.age_commitment_proof + : NULL), + TALER_TESTING_make_trait_h_age_commitment ( + index, + ws->age > 0 + ? &cs->details.h_age_commitment + : NULL), + TALER_TESTING_trait_end () + }; + + return TALER_TESTING_get_trait ( + (ws->expected_response_code == MHD_HTTP_OK) + ? &traits[0] /* we have reserve history */ + : &traits[1], /* skip reserve history */ + ret, + trait, + index); + } }