aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-11 09:36:01 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-11 09:36:01 +0100
commit0995bdd1d05356ed5f97954449f5a5c74a41bdc5 (patch)
tree6feb57a46708ea95e0b1921d9ffa3e8210ae1f13 /src/testing
parent532d4ad0dca62055056e5b6093e82daa3541f690 (diff)
downloadexchange-0995bdd1d05356ed5f97954449f5a5c74a41bdc5.tar.xz
-get tests to pass
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_exchange_api.c18
-rw-r--r--src/testing/testing_api_cmd_insert_deposit.c2
-rw-r--r--src/testing/testing_api_cmd_recoup.c2
-rw-r--r--src/testing/testing_api_cmd_refresh.c18
-rw-r--r--src/testing/testing_api_cmd_withdraw.c6
5 files changed, 28 insertions, 18 deletions
diff --git a/src/testing/test_exchange_api.c b/src/testing/test_exchange_api.c
index d045c21ea..b1779a7d4 100644
--- a/src/testing/test_exchange_api.c
+++ b/src/testing/test_exchange_api.c
@@ -415,6 +415,16 @@ run (void *cls,
"EUR:0.08",
bc.exchange_payto,
bc.user43_payto),
+ /* In case of CS, one transaction above succeeded that
+ failed for RSA, hence we need to check for an extra transfer here */
+ uses_cs
+ ? TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-98c",
+ ec.exchange_url,
+ "EUR:0.98",
+ bc.exchange_payto,
+ bc.user42_payto)
+ : TALER_TESTING_cmd_sleep ("dummy",
+ 0),
TALER_TESTING_cmd_check_bank_empty ("check_bank_empty"),
TALER_TESTING_cmd_track_transaction ("deposit-wtid-ok",
"deposit-simple",
@@ -865,11 +875,11 @@ run (void *cls,
MHD_HTTP_OK,
"recoup-withdraw-coin-2a",
config_file),
- /* Check recoup is failing for the coin with the reused coin key */
+ /* Check recoup is failing for the coin with the reused coin key
+ (fails either because of denomination conflict (RSA) or
+ double-spending (CS))*/
TALER_TESTING_cmd_recoup ("recoup-2x",
- uses_cs
- ? MHD_HTTP_OK
- : MHD_HTTP_CONFLICT,
+ MHD_HTTP_CONFLICT,
"withdraw-coin-1x",
"EUR:1"),
TALER_TESTING_cmd_recoup ("recoup-2",
diff --git a/src/testing/testing_api_cmd_insert_deposit.c b/src/testing/testing_api_cmd_insert_deposit.c
index 6c9f36e00..be49df949 100644
--- a/src/testing/testing_api_cmd_insert_deposit.c
+++ b/src/testing/testing_api_cmd_insert_deposit.c
@@ -201,7 +201,7 @@ insert_deposit_run (void *cls,
struct TALER_CoinPubHash c_hash;
struct TALER_PlanchetDetail pd;
struct TALER_BlindedDenominationSignature bds;
- struct TALER_PlanchetSecretsP ps;
+ struct TALER_PlanchetMasterSecretP ps;
struct TALER_ExchangeWithdrawValues alg_values;
union TALER_DenominationBlindingKeyP bks;
diff --git a/src/testing/testing_api_cmd_recoup.c b/src/testing/testing_api_cmd_recoup.c
index 74c294ef4..85256c207 100644
--- a/src/testing/testing_api_cmd_recoup.c
+++ b/src/testing/testing_api_cmd_recoup.c
@@ -239,7 +239,7 @@ recoup_run (void *cls,
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
const struct TALER_DenominationSignature *coin_sig;
- const struct TALER_PlanchetSecretsP *planchet;
+ const struct TALER_PlanchetMasterSecretP *planchet;
char *cref;
unsigned int idx;
const struct TALER_ExchangeWithdrawValues *ewv;
diff --git a/src/testing/testing_api_cmd_refresh.c b/src/testing/testing_api_cmd_refresh.c
index fe443d214..769a8fef8 100644
--- a/src/testing/testing_api_cmd_refresh.c
+++ b/src/testing/testing_api_cmd_refresh.c
@@ -130,7 +130,7 @@ struct RefreshMeltState
/**
* Entropy seed for the refresh-melt operation.
*/
- struct TALER_PlanchetSecretsP ps;
+ struct TALER_RefreshMasterSecretP rms;
/**
* Private key of the dirty coin being melted.
@@ -218,7 +218,7 @@ struct RefreshRevealState
* Array of @e num_fresh_coins planchet secrets derived
* from the transfer secret per fresh coin.
*/
- struct TALER_PlanchetSecretsP *psa;
+ struct TALER_PlanchetMasterSecretP *psa;
/**
* Interpreter state.
@@ -361,7 +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_PlanchetMasterSecretP *psa,
const struct TALER_DenominationSignature *sigs)
{
struct RefreshRevealState *rrs = cls;
@@ -423,7 +423,7 @@ reveal_cb (void *cls,
case MHD_HTTP_OK:
rrs->psa = GNUNET_memdup (psa,
num_coins
- * sizeof (struct TALER_PlanchetSecretsP));
+ * sizeof (struct TALER_PlanchetMasterSecretP));
rrs->fresh_coins = GNUNET_new_array (num_coins,
struct TALER_TESTING_FreshCoinData);
for (unsigned int i = 0; i<num_coins; i++)
@@ -501,7 +501,7 @@ refresh_reveal_run (void *cls,
// FIXME: use trait for 'rms'!
rms = melt_cmd->cls;
rrs->rrh = TALER_EXCHANGE_refreshes_reveal (is->exchange,
- &rms->ps,
+ &rms->rms,
&rms->refresh_data,
rms->num_fresh_coins,
rms->alg_values,
@@ -1008,7 +1008,7 @@ melt_cb (void *cls,
TALER_LOG_DEBUG ("Doubling the melt (%s)\n",
rms->is->commands[rms->is->ip].label);
rms->rmh = TALER_EXCHANGE_melt (rms->is->exchange,
- &rms->ps,
+ &rms->rms,
&rms->refresh_data,
&melt_cb,
rms);
@@ -1044,7 +1044,7 @@ melt_run (void *cls,
melt_fresh_amounts = default_melt_fresh_amounts;
rms->is = is;
rms->noreveal_index = UINT16_MAX;
- TALER_planchet_setup_random (&rms->ps);
+ TALER_refresh_master_setup_random (&rms->rms);
for (num_fresh_coins = 0;
NULL != melt_fresh_amounts[num_fresh_coins];
num_fresh_coins++)
@@ -1145,7 +1145,7 @@ melt_run (void *cls,
rms->refresh_data.fresh_pks = rms->fresh_pks;
rms->refresh_data.fresh_pks_len = num_fresh_coins;
rms->rmh = TALER_EXCHANGE_melt (is->exchange,
- &rms->ps,
+ &rms->rms,
&rms->refresh_data,
&melt_cb,
rms);
@@ -1233,7 +1233,7 @@ melt_traits (void *cls,
&rms->bks[index]),
TALER_TESTING_make_trait_exchange_wd_value (index,
&rms->alg_values[index]),
- TALER_TESTING_make_trait_refresh_secret (&rms->ps),
+ TALER_TESTING_make_trait_refresh_secret (&rms->rms),
TALER_TESTING_trait_end ()
};
diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c
index f1b38fd41..c7265c6cd 100644
--- a/src/testing/testing_api_cmd_withdraw.c
+++ b/src/testing/testing_api_cmd_withdraw.c
@@ -129,7 +129,7 @@ struct WithdrawState
/**
* Private key material of the coin, set by the interpreter.
*/
- struct TALER_PlanchetSecretsP ps;
+ struct TALER_PlanchetMasterSecretP ps;
/**
* Reserve history entry that corresponds to this operation.
@@ -407,11 +407,11 @@ withdraw_run (void *cls,
&ws->reserve_pub);
if (NULL == ws->reuse_coin_key_ref)
{
- TALER_planchet_setup_random (&ws->ps);
+ TALER_planchet_master_setup_random (&ws->ps);
}
else
{
- const struct TALER_PlanchetSecretsP *ps;
+ const struct TALER_PlanchetMasterSecretP *ps;
const struct TALER_TESTING_Command *cref;
char *cstr;
unsigned int index;