aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/Makefile.am3
-rw-r--r--src/testing/test_exchange_api_expire_reserve_now-cs.conf (renamed from src/testing/test_exchange_api_expire_reserve_now.conf)2
-rw-r--r--src/testing/test_exchange_api_expire_reserve_now-rsa.conf4
-rw-r--r--src/testing/testing_api_cmd_recoup_refresh.c13
-rw-r--r--src/testing/testing_api_cmd_refresh.c28
-rw-r--r--src/testing/testing_api_cmd_withdraw.c2
6 files changed, 41 insertions, 11 deletions
diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index 16c7a563f..1704f3cb4 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -503,7 +503,8 @@ EXTRA_DIST = \
test_exchange_api_twisted.conf \
test_exchange_api_keys_cherry_picking-cs.conf \
test_exchange_api_keys_cherry_picking-rsa.conf \
- test_exchange_api_expire_reserve_now.conf \
+ test_exchange_api_expire_reserve_now-cs.conf \
+ test_exchange_api_expire_reserve_now-rsa.conf \
test_taler_exchange_httpd_home/.config/taler/account-1.json \
test_taler_exchange_httpd_home/.local/share/taler/exchange-offline/master.priv \
test_taler_exchange_httpd_home/.local/share/taler/exchange/offline-keys/master.priv \
diff --git a/src/testing/test_exchange_api_expire_reserve_now.conf b/src/testing/test_exchange_api_expire_reserve_now-cs.conf
index 05bca956b..2cc4e0917 100644
--- a/src/testing/test_exchange_api_expire_reserve_now.conf
+++ b/src/testing/test_exchange_api_expire_reserve_now-cs.conf
@@ -1,4 +1,4 @@
-@INLINE@ test_exchange_api.conf
+@INLINE@ test_exchange_api-cs.conf
[exchangedb]
IDLE_RESERVE_EXPIRATION_TIME = 0 s
diff --git a/src/testing/test_exchange_api_expire_reserve_now-rsa.conf b/src/testing/test_exchange_api_expire_reserve_now-rsa.conf
new file mode 100644
index 000000000..52b829871
--- /dev/null
+++ b/src/testing/test_exchange_api_expire_reserve_now-rsa.conf
@@ -0,0 +1,4 @@
+@INLINE@ test_exchange_api-rsa.conf
+
+[exchangedb]
+IDLE_RESERVE_EXPIRATION_TIME = 0 s
diff --git a/src/testing/testing_api_cmd_recoup_refresh.c b/src/testing/testing_api_cmd_recoup_refresh.c
index a1f34f70e..fd8f1c36c 100644
--- a/src/testing/testing_api_cmd_recoup_refresh.c
+++ b/src/testing/testing_api_cmd_recoup_refresh.c
@@ -230,6 +230,7 @@ recoup_refresh_run (void *cls,
{
struct RecoupRefreshState *ps = cls;
const struct TALER_TESTING_Command *coin_cmd;
+ const struct TALER_TESTING_Command *melt_cmd;
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
const struct TALER_DenominationSignature *coin_sig;
@@ -251,13 +252,21 @@ recoup_refresh_run (void *cls,
coin_cmd = TALER_TESTING_interpreter_lookup_command (is,
cref);
GNUNET_free (cref);
-
if (NULL == coin_cmd)
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (is);
return;
}
+ melt_cmd = TALER_TESTING_interpreter_lookup_command (is,
+ ps->melt_reference);
+ if (NULL == melt_cmd)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+
if (GNUNET_OK !=
TALER_TESTING_get_trait_coin_priv (coin_cmd,
idx,
@@ -268,7 +277,7 @@ recoup_refresh_run (void *cls,
return;
}
if (GNUNET_OK !=
- TALER_TESTING_get_trait_exchange_wd_value (coin_cmd,
+ TALER_TESTING_get_trait_exchange_wd_value (melt_cmd,
idx,
&ewv))
{
diff --git a/src/testing/testing_api_cmd_refresh.c b/src/testing/testing_api_cmd_refresh.c
index 07476a7b3..88c694934 100644
--- a/src/testing/testing_api_cmd_refresh.c
+++ b/src/testing/testing_api_cmd_refresh.c
@@ -117,12 +117,12 @@ struct RefreshMeltState
struct TALER_EXCHANGE_DenomPublicKey *fresh_pks;
/**
- * Array of @a num_fresh_coins of exchange values contributed to the refresh operation
+ * Array of @e num_fresh_coins of exchange values contributed to the refresh operation
*/
struct TALER_ExchangeWithdrawValues *alg_values;
/**
- * Array of @a num_fresh_coins of blinding key secrets
+ * Array of @e num_fresh_coins of blinding key secrets
* created during the melt operation.
*/
union TALER_DenominationBlindingKeyP *bks;
@@ -215,6 +215,12 @@ struct RefreshRevealState
struct TALER_TESTING_FreshCoinData *fresh_coins;
/**
+ * Array of @e num_fresh_coins planchet secrets derived
+ * from the transfer secret per fresh coin.
+ */
+ struct TALER_PlanchetSecretsP *psa;
+
+ /**
* Interpreter state.
*/
struct TALER_TESTING_Interpreter *is;
@@ -346,6 +352,7 @@ do_reveal_retry (void *cls)
* failed.
* @param coin_privs array of @a num_coins private keys for the
* coins that were created, NULL on error.
+ * @param psa array of @a num_coins planchet secrets (derived from the transfer secret) for each of the coins
* @param sigs array of signature over @a num_coins coins,
* NULL on error.
*/
@@ -354,6 +361,7 @@ reveal_cb (void *cls,
const struct TALER_EXCHANGE_HttpResponse *hr,
unsigned int num_coins,
const struct TALER_CoinSpendPrivateKeyP *coin_privs,
+ const struct TALER_PlanchetSecretsP *psa,
const struct TALER_DenominationSignature *sigs)
{
struct RefreshRevealState *rrs = cls;
@@ -413,6 +421,9 @@ reveal_cb (void *cls,
switch (hr->http_status)
{
case MHD_HTTP_OK:
+ rrs->psa = GNUNET_memdup (psa,
+ num_coins
+ * sizeof (struct TALER_PlanchetSecretsP));
rrs->fresh_coins = GNUNET_new_array (num_coins,
struct TALER_TESTING_FreshCoinData);
for (unsigned int i = 0; i<num_coins; i++)
@@ -540,7 +551,7 @@ refresh_reveal_cleanup (void *cls,
TALER_denom_sig_free (&rrs->fresh_coins[j].sig);
GNUNET_free (rrs->fresh_coins);
- rrs->fresh_coins = NULL;
+ GNUNET_free (rrs->psa);
rrs->num_fresh_coins = 0;
GNUNET_free (rrs);
}
@@ -806,8 +817,10 @@ refresh_link_run (void *cls,
}
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
- if (GNUNET_OK != TALER_TESTING_get_trait_coin_priv
- (coin_cmd, 0, &coin_priv))
+ if (GNUNET_OK !=
+ TALER_TESTING_get_trait_coin_priv (coin_cmd,
+ 0,
+ &coin_priv))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (rls->is);
@@ -1216,9 +1229,10 @@ melt_traits (void *cls,
&rms->fresh_pks[index]),
TALER_TESTING_make_trait_coin_priv (0,
rms->melt_priv),
- // ????
TALER_TESTING_make_trait_blinding_key (index,
&rms->bks[index]),
+ TALER_TESTING_make_trait_exchange_wd_value (index,
+ &rms->alg_values[index]),
TALER_TESTING_trait_end ()
};
@@ -1392,6 +1406,8 @@ refresh_reveal_traits (void *cls,
&rrs->num_fresh_coins),
TALER_TESTING_make_trait_fresh_coins (
(const struct TALER_TESTING_FreshCoinData **) &rrs->fresh_coins),
+ TALER_TESTING_make_trait_planchet_secrets (index,
+ &rrs->psa[index]),
TALER_TESTING_trait_end ()
};
diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c
index 306409155..f1b38fd41 100644
--- a/src/testing/testing_api_cmd_withdraw.c
+++ b/src/testing/testing_api_cmd_withdraw.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2018-2021 Taler Systems SA
+ Copyright (C) 2018-2022 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by