/refresh/*: #5284.

This commit is contained in:
Marcello Stanisci 2018-12-18 16:27:50 +01:00
parent 18b39a4597
commit 2fc84dd07f
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F
4 changed files with 10 additions and 44 deletions

View File

@ -457,7 +457,6 @@ run (void *cls,
TALER_TESTING_cmd_refresh_melt_with_retry TALER_TESTING_cmd_refresh_melt_with_retry
(TALER_TESTING_cmd_refresh_melt (TALER_TESTING_cmd_refresh_melt
(melt_label, (melt_label,
is->exchange,
AMOUNT_4, AMOUNT_4,
withdraw_label, withdraw_label,
MHD_HTTP_OK)); MHD_HTTP_OK));
@ -465,14 +464,12 @@ run (void *cls,
TALER_TESTING_cmd_refresh_reveal_with_retry TALER_TESTING_cmd_refresh_reveal_with_retry
(TALER_TESTING_cmd_refresh_reveal (TALER_TESTING_cmd_refresh_reveal
(reveal_label, (reveal_label,
is->exchange,
melt_label, melt_label,
MHD_HTTP_OK)); MHD_HTTP_OK));
unit[4] = unit[4] =
TALER_TESTING_cmd_refresh_link_with_retry TALER_TESTING_cmd_refresh_link_with_retry
(TALER_TESTING_cmd_refresh_link (TALER_TESTING_cmd_refresh_link
("refresh-link", ("refresh-link",
is->exchange,
reveal_label, reveal_label,
MHD_HTTP_OK)); MHD_HTTP_OK));
unit[5] = TALER_TESTING_cmd_end (); unit[5] = TALER_TESTING_cmd_end ();

View File

@ -315,14 +315,14 @@ run (void *cls,
* Melt the rest of the coin's value * Melt the rest of the coin's value
* (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */ * (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */
TALER_TESTING_cmd_refresh_melt_double TALER_TESTING_cmd_refresh_melt_double
("refresh-melt-1", is->exchange, "EUR:4", ("refresh-melt-1", "EUR:4",
"refresh-withdraw-coin-1", MHD_HTTP_OK), "refresh-withdraw-coin-1", MHD_HTTP_OK),
/** /**
* Complete (successful) melt operation, and * Complete (successful) melt operation, and
* withdraw the coins * withdraw the coins
*/ */
TALER_TESTING_cmd_refresh_reveal TALER_TESTING_cmd_refresh_reveal
("refresh-reveal-1", is->exchange, ("refresh-reveal-1",
"refresh-melt-1", MHD_HTTP_OK), "refresh-melt-1", MHD_HTTP_OK),
/** /**
@ -330,13 +330,13 @@ run (void *cls,
*/ */
TALER_TESTING_cmd_refresh_reveal TALER_TESTING_cmd_refresh_reveal
("refresh-reveal-1-idempotency", ("refresh-reveal-1-idempotency",
is->exchange, "refresh-melt-1", MHD_HTTP_OK), "refresh-melt-1", MHD_HTTP_OK),
/** /**
* Test that /refresh/link works * Test that /refresh/link works
*/ */
TALER_TESTING_cmd_refresh_link TALER_TESTING_cmd_refresh_link
("refresh-link-1", is->exchange, ("refresh-link-1",
"refresh-reveal-1", MHD_HTTP_OK), "refresh-reveal-1", MHD_HTTP_OK),
/** /**
@ -366,7 +366,7 @@ run (void *cls,
/* Test running a failing melt operation (same operation /* Test running a failing melt operation (same operation
* again must fail) */ * again must fail) */
TALER_TESTING_cmd_refresh_melt TALER_TESTING_cmd_refresh_melt
("refresh-melt-failing", is->exchange, "EUR:4", ("refresh-melt-failing", "EUR:4",
"refresh-withdraw-coin-1", MHD_HTTP_FORBIDDEN), "refresh-withdraw-coin-1", MHD_HTTP_FORBIDDEN),
/* FIXME: also test with coin that was already melted /* FIXME: also test with coin that was already melted

View File

@ -76,11 +76,6 @@ struct RefreshMeltState
*/ */
struct TALER_EXCHANGE_RefreshMeltHandle *rmh; struct TALER_EXCHANGE_RefreshMeltHandle *rmh;
/**
* Connection to the exchange.
*/
struct TALER_EXCHANGE_Handle *exchange;
/** /**
* Interpreter state. * Interpreter state.
*/ */
@ -159,11 +154,6 @@ struct RefreshRevealState
*/ */
struct FreshCoin *fresh_coins; struct FreshCoin *fresh_coins;
/**
* Connection to the exchange.
*/
struct TALER_EXCHANGE_Handle *exchange;
/** /**
* Interpreter state. * Interpreter state.
*/ */
@ -214,11 +204,6 @@ struct RefreshLinkState
*/ */
struct TALER_EXCHANGE_RefreshLinkHandle *rlh; struct TALER_EXCHANGE_RefreshLinkHandle *rlh;
/**
* Connection to the exchange.
*/
struct TALER_EXCHANGE_Handle *exchange;
/** /**
* Interpreter state. * Interpreter state.
*/ */
@ -415,7 +400,7 @@ refresh_reveal_run (void *cls,
} }
rms = melt_cmd->cls; rms = melt_cmd->cls;
rrs->rrh = TALER_EXCHANGE_refresh_reveal rrs->rrh = TALER_EXCHANGE_refresh_reveal
(rrs->exchange, (is->exchange,
rms->refresh_data_length, rms->refresh_data_length,
rms->refresh_data, rms->refresh_data,
rms->noreveal_index, rms->noreveal_index,
@ -727,7 +712,7 @@ refresh_link_run (void *cls,
/* finally, use private key from withdraw sign command */ /* finally, use private key from withdraw sign command */
rls->rlh = TALER_EXCHANGE_refresh_link rls->rlh = TALER_EXCHANGE_refresh_link
(rls->exchange, coin_priv, &link_cb, rls); (is->exchange, coin_priv, &link_cb, rls);
if (NULL == rls->rlh) if (NULL == rls->rlh)
{ {
@ -865,7 +850,7 @@ melt_cb (void *cls,
TALER_LOG_DEBUG ("Doubling the melt (%s)\n", TALER_LOG_DEBUG ("Doubling the melt (%s)\n",
rms->is->commands[rms->is->ip].label); rms->is->commands[rms->is->ip].label);
rms->rmh = TALER_EXCHANGE_refresh_melt rms->rmh = TALER_EXCHANGE_refresh_melt
(rms->exchange, rms->refresh_data_length, (rms->is->exchange, rms->refresh_data_length,
rms->refresh_data, &melt_cb, rms); rms->refresh_data, &melt_cb, rms);
rms->double_melt = GNUNET_NO; rms->double_melt = GNUNET_NO;
return; return;
@ -971,7 +956,7 @@ refresh_melt_run (void *cls,
return; return;
} }
fresh_pk = TALER_TESTING_find_pk fresh_pk = TALER_TESTING_find_pk
(TALER_EXCHANGE_get_keys (rms->exchange), &fresh_amount); (TALER_EXCHANGE_get_keys (is->exchange), &fresh_amount);
if (NULL == fresh_pk) if (NULL == fresh_pk)
{ {
GNUNET_break (0); GNUNET_break (0);
@ -994,7 +979,7 @@ refresh_melt_run (void *cls,
return; return;
} }
rms->rmh = TALER_EXCHANGE_refresh_melt rms->rmh = TALER_EXCHANGE_refresh_melt
(rms->exchange, rms->refresh_data_length, (is->exchange, rms->refresh_data_length,
rms->refresh_data, &melt_cb, rms); rms->refresh_data, &melt_cb, rms);
if (NULL == rms->rmh) if (NULL == rms->rmh)
@ -1076,7 +1061,6 @@ refresh_melt_traits (void *cls,
* Create a "refresh melt" command. * Create a "refresh melt" command.
* *
* @param label command label. * @param label command label.
* @param exchange connection to the exchange.
* @param amount amount to be melted. * @param amount amount to be melted.
* @param coin_reference reference to a command * @param coin_reference reference to a command
* that will provide a coin to refresh. * that will provide a coin to refresh.
@ -1087,7 +1071,6 @@ refresh_melt_traits (void *cls,
struct TALER_TESTING_Command struct TALER_TESTING_Command
TALER_TESTING_cmd_refresh_melt TALER_TESTING_cmd_refresh_melt
(const char *label, (const char *label,
struct TALER_EXCHANGE_Handle *exchange,
const char *amount, const char *amount,
const char *coin_reference, const char *coin_reference,
unsigned int expected_response_code) unsigned int expected_response_code)
@ -1102,7 +1085,6 @@ TALER_TESTING_cmd_refresh_melt
rms = GNUNET_new (struct RefreshMeltState); rms = GNUNET_new (struct RefreshMeltState);
rms->melted_coin = md; rms->melted_coin = md;
rms->expected_response_code = expected_response_code; rms->expected_response_code = expected_response_code;
rms->exchange = exchange;
cmd.label = label; cmd.label = label;
cmd.cls = rms; cmd.cls = rms;
@ -1130,7 +1112,6 @@ TALER_TESTING_cmd_refresh_melt
struct TALER_TESTING_Command struct TALER_TESTING_Command
TALER_TESTING_cmd_refresh_melt_double TALER_TESTING_cmd_refresh_melt_double
(const char *label, (const char *label,
struct TALER_EXCHANGE_Handle *exchange,
const char *amount, const char *amount,
const char *coin_reference, const char *coin_reference,
unsigned int expected_response_code) unsigned int expected_response_code)
@ -1145,7 +1126,6 @@ TALER_TESTING_cmd_refresh_melt_double
rms = GNUNET_new (struct RefreshMeltState); rms = GNUNET_new (struct RefreshMeltState);
rms->melted_coin = md; rms->melted_coin = md;
rms->expected_response_code = expected_response_code; rms->expected_response_code = expected_response_code;
rms->exchange = exchange;
rms->double_melt = GNUNET_YES; rms->double_melt = GNUNET_YES;
cmd.label = label; cmd.label = label;
@ -1244,7 +1224,6 @@ refresh_reveal_traits (void *cls,
struct TALER_TESTING_Command struct TALER_TESTING_Command
TALER_TESTING_cmd_refresh_reveal TALER_TESTING_cmd_refresh_reveal
(const char *label, (const char *label,
struct TALER_EXCHANGE_Handle *exchange,
const char *melt_reference, const char *melt_reference,
unsigned int expected_response_code) unsigned int expected_response_code)
{ {
@ -1253,7 +1232,6 @@ TALER_TESTING_cmd_refresh_reveal
rrs = GNUNET_new (struct RefreshRevealState); rrs = GNUNET_new (struct RefreshRevealState);
rrs->melt_reference = melt_reference; rrs->melt_reference = melt_reference;
rrs->exchange = exchange;
rrs->expected_response_code = expected_response_code; rrs->expected_response_code = expected_response_code;
cmd.cls = rrs; cmd.cls = rrs;
@ -1287,7 +1265,6 @@ TALER_TESTING_cmd_refresh_reveal_with_retry (struct TALER_TESTING_Command cmd)
* Create a "refresh link" command. * Create a "refresh link" command.
* *
* @param label command label. * @param label command label.
* @param exchange connection to the exchange.
* @param reveal_reference reference to a "refresh reveal" CMD. * @param reveal_reference reference to a "refresh reveal" CMD.
* @param expected_response_code expected HTTP response code * @param expected_response_code expected HTTP response code
* *
@ -1296,7 +1273,6 @@ TALER_TESTING_cmd_refresh_reveal_with_retry (struct TALER_TESTING_Command cmd)
struct TALER_TESTING_Command struct TALER_TESTING_Command
TALER_TESTING_cmd_refresh_link TALER_TESTING_cmd_refresh_link
(const char *label, (const char *label,
struct TALER_EXCHANGE_Handle *exchange,
const char *reveal_reference, const char *reveal_reference,
unsigned int expected_response_code) unsigned int expected_response_code)
{ {
@ -1305,7 +1281,6 @@ TALER_TESTING_cmd_refresh_link
rrs = GNUNET_new (struct RefreshLinkState); rrs = GNUNET_new (struct RefreshLinkState);
rrs->reveal_reference = reveal_reference; rrs->reveal_reference = reveal_reference;
rrs->exchange = exchange;
rrs->expected_response_code = expected_response_code; rrs->expected_response_code = expected_response_code;
cmd.cls = rrs; cmd.cls = rrs;

View File

@ -1059,7 +1059,6 @@ TALER_TESTING_cmd_deposit_with_retry (struct TALER_TESTING_Command cmd);
* Create a "refresh melt" command. * Create a "refresh melt" command.
* *
* @param label command label. * @param label command label.
* @param exchange connection to the exchange.
* @param amount amount to be melted. * @param amount amount to be melted.
* @param coin_reference reference to a command * @param coin_reference reference to a command
* that will provide a coin to refresh. * that will provide a coin to refresh.
@ -1070,7 +1069,6 @@ TALER_TESTING_cmd_deposit_with_retry (struct TALER_TESTING_Command cmd);
struct TALER_TESTING_Command struct TALER_TESTING_Command
TALER_TESTING_cmd_refresh_melt TALER_TESTING_cmd_refresh_melt
(const char *label, (const char *label,
struct TALER_EXCHANGE_Handle *exchange,
const char *amount, const char *amount,
const char *coin_reference, const char *coin_reference,
unsigned int expected_response_code); unsigned int expected_response_code);
@ -1082,7 +1080,6 @@ TALER_TESTING_cmd_refresh_melt
* request, see #5312. * request, see #5312.
* *
* @param label command label * @param label command label
* @param exchange connection to the exchange
* @param amount FIXME not used. * @param amount FIXME not used.
* @param coin_reference reference to a command that will provide * @param coin_reference reference to a command that will provide
* a coin to refresh * a coin to refresh
@ -1093,7 +1090,6 @@ TALER_TESTING_cmd_refresh_melt
struct TALER_TESTING_Command struct TALER_TESTING_Command
TALER_TESTING_cmd_refresh_melt_double TALER_TESTING_cmd_refresh_melt_double
(const char *label, (const char *label,
struct TALER_EXCHANGE_Handle *exchange,
const char *amount, const char *amount,
const char *coin_reference, const char *coin_reference,
unsigned int expected_response_code); unsigned int expected_response_code);
@ -1122,7 +1118,6 @@ TALER_TESTING_cmd_refresh_melt_with_retry (struct TALER_TESTING_Command cmd);
struct TALER_TESTING_Command struct TALER_TESTING_Command
TALER_TESTING_cmd_refresh_reveal TALER_TESTING_cmd_refresh_reveal
(const char *label, (const char *label,
struct TALER_EXCHANGE_Handle *exchange,
const char *melt_reference, const char *melt_reference,
unsigned int expected_response_code); unsigned int expected_response_code);
@ -1150,7 +1145,6 @@ TALER_TESTING_cmd_refresh_reveal_with_retry (struct TALER_TESTING_Command cmd);
struct TALER_TESTING_Command struct TALER_TESTING_Command
TALER_TESTING_cmd_refresh_link TALER_TESTING_cmd_refresh_link
(const char *label, (const char *label,
struct TALER_EXCHANGE_Handle *exchange,
const char *reveal_reference, const char *reveal_reference,
unsigned int expected_response_code); unsigned int expected_response_code);