From 3e8c797bb78dfc0731bfce17e2401d3247ad4d10 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 27 Apr 2022 13:28:28 +0200 Subject: -get p2p test to pass --- src/exchange/taler-exchange-httpd_purses_deposit.c | 1 - src/lib/exchange_api_purse_deposit.c | 16 +++++++++------- src/testing/Makefile.am | 2 +- src/util/crypto_contract.c | 6 ------ 4 files changed, 10 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/exchange/taler-exchange-httpd_purses_deposit.c b/src/exchange/taler-exchange-httpd_purses_deposit.c index e2a5d34f4..d29487af5 100644 --- a/src/exchange/taler-exchange-httpd_purses_deposit.c +++ b/src/exchange/taler-exchange-httpd_purses_deposit.c @@ -325,7 +325,6 @@ parse_coin (struct MHD_Connection *connection, if (GNUNET_OK != res) return res; } - if (GNUNET_OK != TALER_wallet_purse_deposit_verify (TEH_base_url, pcc->purse_pub, diff --git a/src/lib/exchange_api_purse_deposit.c b/src/lib/exchange_api_purse_deposit.c index 540be0e2c..dfe9a6ecf 100644 --- a/src/lib/exchange_api_purse_deposit.c +++ b/src/lib/exchange_api_purse_deposit.c @@ -70,11 +70,6 @@ struct TALER_EXCHANGE_PurseDepositHandle */ void *cb_cls; - /** - * Expected value in the purse after fees. - */ - struct TALER_Amount purse_value_after_fees; - /** * Public key of the purse. */ @@ -102,8 +97,10 @@ handle_purse_deposit_finished (void *cls, .hr.reply = j, .hr.http_status = (unsigned int) response_code }; + const struct TALER_EXCHANGE_Keys *keys; pch->job = NULL; + keys = TALER_EXCHANGE_get_keys (pch->exchange); switch (response_code) { case 0: @@ -124,7 +121,7 @@ handle_purse_deposit_finished (void *cls, GNUNET_JSON_spec_timestamp ("exchange_timestamp", &etime), TALER_JSON_spec_amount ("total_deposited", - pch->purse_value_after_fees.currency, + keys->currency, &total_deposited), GNUNET_JSON_spec_end () }; @@ -242,6 +239,11 @@ TALER_EXCHANGE_purse_deposit ( char *url; char arg_str[sizeof (pch->purse_pub) * 2 + 32]; + if (0 == num_deposits) + { + GNUNET_break (0); + return NULL; + } GNUNET_assert (GNUNET_YES == TEAH_handle_is_ready (exchange)); pch = GNUNET_new (struct TALER_EXCHANGE_PurseDepositHandle); @@ -301,9 +303,9 @@ TALER_EXCHANGE_purse_deposit ( GNUNET_free (pch); return NULL; } +#endif GNUNET_CRYPTO_eddsa_key_get_public (&deposit->coin_priv.eddsa_priv, &coin_pub.eddsa_pub); -#endif TALER_wallet_purse_deposit_sign ( url, &pch->purse_pub, diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am index b985dd28c..56b009af5 100644 --- a/src/testing/Makefile.am +++ b/src/testing/Makefile.am @@ -286,7 +286,7 @@ test_exchange_api_rsa_LDADD = \ $(XLIB) test_exchange_p2p_cs_SOURCES = \ - test_exchange_api.c + test_exchange_p2p.c test_exchange_p2p_cs_LDADD = \ libtalertesting.la \ $(top_builddir)/src/lib/libtalerexchange.la \ diff --git a/src/util/crypto_contract.c b/src/util/crypto_contract.c index bcfe95239..fe6b1e6af 100644 --- a/src/util/crypto_contract.c +++ b/src/util/crypto_contract.c @@ -278,9 +278,6 @@ TALER_CRYPTO_contract_encrypt_for_merge ( GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, &nonce, sizeof (nonce)); - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Encrypting with key %s\n", - TALER_B2S (&key)); contract_encrypt (&nonce, &key, sizeof (key), @@ -318,9 +315,6 @@ TALER_CRYPTO_contract_decrypt_for_merge ( GNUNET_break (0); return NULL; } - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Decrypting with key %s\n", - TALER_B2S (&key)); if (GNUNET_OK != contract_decrypt (&key, sizeof (key), -- cgit v1.2.3