diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-12-18 16:27:50 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-12-18 16:27:50 +0100 |
commit | 2fc84dd07fdf13d3d9b933060572ebf4e24bf50c (patch) | |
tree | dd2e7e16577dfa2b800afb778c694bb9e5a48a5e | |
parent | 18b39a45978d7e1d50dc64085afd4ab731a79b4d (diff) |
/refresh/*: #5284.
-rw-r--r-- | src/benchmark/taler-exchange-benchmark.c | 3 | ||||
-rw-r--r-- | src/exchange-lib/test_exchange_api_new.c | 10 | ||||
-rw-r--r-- | src/exchange-lib/testing_api_cmd_refresh.c | 35 | ||||
-rw-r--r-- | src/include/taler_testing_lib.h | 6 |
4 files changed, 10 insertions, 44 deletions
diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c index 7c4e69fe6..e46ae9ce3 100644 --- a/src/benchmark/taler-exchange-benchmark.c +++ b/src/benchmark/taler-exchange-benchmark.c @@ -457,7 +457,6 @@ run (void *cls, TALER_TESTING_cmd_refresh_melt_with_retry (TALER_TESTING_cmd_refresh_melt (melt_label, - is->exchange, AMOUNT_4, withdraw_label, MHD_HTTP_OK)); @@ -465,14 +464,12 @@ run (void *cls, TALER_TESTING_cmd_refresh_reveal_with_retry (TALER_TESTING_cmd_refresh_reveal (reveal_label, - is->exchange, melt_label, MHD_HTTP_OK)); unit[4] = TALER_TESTING_cmd_refresh_link_with_retry (TALER_TESTING_cmd_refresh_link ("refresh-link", - is->exchange, reveal_label, MHD_HTTP_OK)); unit[5] = TALER_TESTING_cmd_end (); diff --git a/src/exchange-lib/test_exchange_api_new.c b/src/exchange-lib/test_exchange_api_new.c index b7bce47b1..8f10a53b4 100644 --- a/src/exchange-lib/test_exchange_api_new.c +++ b/src/exchange-lib/test_exchange_api_new.c @@ -315,14 +315,14 @@ run (void *cls, * Melt the rest of the coin's value * (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */ 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), /** * Complete (successful) melt operation, and * withdraw the coins */ TALER_TESTING_cmd_refresh_reveal - ("refresh-reveal-1", is->exchange, + ("refresh-reveal-1", "refresh-melt-1", MHD_HTTP_OK), /** @@ -330,13 +330,13 @@ run (void *cls, */ TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-1-idempotency", - is->exchange, "refresh-melt-1", MHD_HTTP_OK), + "refresh-melt-1", MHD_HTTP_OK), /** * Test that /refresh/link works */ TALER_TESTING_cmd_refresh_link - ("refresh-link-1", is->exchange, + ("refresh-link-1", "refresh-reveal-1", MHD_HTTP_OK), /** @@ -366,7 +366,7 @@ run (void *cls, /* Test running a failing melt operation (same operation * again must fail) */ TALER_TESTING_cmd_refresh_melt - ("refresh-melt-failing", is->exchange, "EUR:4", + ("refresh-melt-failing", "EUR:4", "refresh-withdraw-coin-1", MHD_HTTP_FORBIDDEN), /* FIXME: also test with coin that was already melted diff --git a/src/exchange-lib/testing_api_cmd_refresh.c b/src/exchange-lib/testing_api_cmd_refresh.c index 85c1f8c95..7b14ecae8 100644 --- a/src/exchange-lib/testing_api_cmd_refresh.c +++ b/src/exchange-lib/testing_api_cmd_refresh.c @@ -77,11 +77,6 @@ struct RefreshMeltState struct TALER_EXCHANGE_RefreshMeltHandle *rmh; /** - * Connection to the exchange. - */ - struct TALER_EXCHANGE_Handle *exchange; - - /** * Interpreter state. */ struct TALER_TESTING_Interpreter *is; @@ -160,11 +155,6 @@ struct RefreshRevealState struct FreshCoin *fresh_coins; /** - * Connection to the exchange. - */ - struct TALER_EXCHANGE_Handle *exchange; - - /** * Interpreter state. */ struct TALER_TESTING_Interpreter *is; @@ -215,11 +205,6 @@ struct RefreshLinkState struct TALER_EXCHANGE_RefreshLinkHandle *rlh; /** - * Connection to the exchange. - */ - struct TALER_EXCHANGE_Handle *exchange; - - /** * Interpreter state. */ struct TALER_TESTING_Interpreter *is; @@ -415,7 +400,7 @@ refresh_reveal_run (void *cls, } rms = melt_cmd->cls; rrs->rrh = TALER_EXCHANGE_refresh_reveal - (rrs->exchange, + (is->exchange, rms->refresh_data_length, rms->refresh_data, rms->noreveal_index, @@ -727,7 +712,7 @@ refresh_link_run (void *cls, /* finally, use private key from withdraw sign command */ rls->rlh = TALER_EXCHANGE_refresh_link - (rls->exchange, coin_priv, &link_cb, rls); + (is->exchange, coin_priv, &link_cb, rls); if (NULL == rls->rlh) { @@ -865,7 +850,7 @@ melt_cb (void *cls, TALER_LOG_DEBUG ("Doubling the melt (%s)\n", rms->is->commands[rms->is->ip].label); 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->double_melt = GNUNET_NO; return; @@ -971,7 +956,7 @@ refresh_melt_run (void *cls, return; } 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) { GNUNET_break (0); @@ -994,7 +979,7 @@ refresh_melt_run (void *cls, return; } rms->rmh = TALER_EXCHANGE_refresh_melt - (rms->exchange, rms->refresh_data_length, + (is->exchange, rms->refresh_data_length, rms->refresh_data, &melt_cb, rms); if (NULL == rms->rmh) @@ -1076,7 +1061,6 @@ refresh_melt_traits (void *cls, * Create a "refresh melt" command. * * @param label command label. - * @param exchange connection to the exchange. * @param amount amount to be melted. * @param coin_reference reference to a command * that will provide a coin to refresh. @@ -1087,7 +1071,6 @@ refresh_melt_traits (void *cls, struct TALER_TESTING_Command TALER_TESTING_cmd_refresh_melt (const char *label, - struct TALER_EXCHANGE_Handle *exchange, const char *amount, const char *coin_reference, unsigned int expected_response_code) @@ -1102,7 +1085,6 @@ TALER_TESTING_cmd_refresh_melt rms = GNUNET_new (struct RefreshMeltState); rms->melted_coin = md; rms->expected_response_code = expected_response_code; - rms->exchange = exchange; cmd.label = label; cmd.cls = rms; @@ -1130,7 +1112,6 @@ TALER_TESTING_cmd_refresh_melt struct TALER_TESTING_Command TALER_TESTING_cmd_refresh_melt_double (const char *label, - struct TALER_EXCHANGE_Handle *exchange, const char *amount, const char *coin_reference, unsigned int expected_response_code) @@ -1145,7 +1126,6 @@ TALER_TESTING_cmd_refresh_melt_double rms = GNUNET_new (struct RefreshMeltState); rms->melted_coin = md; rms->expected_response_code = expected_response_code; - rms->exchange = exchange; rms->double_melt = GNUNET_YES; cmd.label = label; @@ -1244,7 +1224,6 @@ refresh_reveal_traits (void *cls, struct TALER_TESTING_Command TALER_TESTING_cmd_refresh_reveal (const char *label, - struct TALER_EXCHANGE_Handle *exchange, const char *melt_reference, unsigned int expected_response_code) { @@ -1253,7 +1232,6 @@ TALER_TESTING_cmd_refresh_reveal rrs = GNUNET_new (struct RefreshRevealState); rrs->melt_reference = melt_reference; - rrs->exchange = exchange; rrs->expected_response_code = expected_response_code; cmd.cls = rrs; @@ -1287,7 +1265,6 @@ TALER_TESTING_cmd_refresh_reveal_with_retry (struct TALER_TESTING_Command cmd) * Create a "refresh link" command. * * @param label command label. - * @param exchange connection to the exchange. * @param reveal_reference reference to a "refresh reveal" CMD. * @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 TALER_TESTING_cmd_refresh_link (const char *label, - struct TALER_EXCHANGE_Handle *exchange, const char *reveal_reference, unsigned int expected_response_code) { @@ -1305,7 +1281,6 @@ TALER_TESTING_cmd_refresh_link rrs = GNUNET_new (struct RefreshLinkState); rrs->reveal_reference = reveal_reference; - rrs->exchange = exchange; rrs->expected_response_code = expected_response_code; cmd.cls = rrs; diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index 3058d4ce5..1ae663fe4 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -1059,7 +1059,6 @@ TALER_TESTING_cmd_deposit_with_retry (struct TALER_TESTING_Command cmd); * Create a "refresh melt" command. * * @param label command label. - * @param exchange connection to the exchange. * @param amount amount to be melted. * @param coin_reference reference to a command * 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 TALER_TESTING_cmd_refresh_melt (const char *label, - struct TALER_EXCHANGE_Handle *exchange, const char *amount, const char *coin_reference, unsigned int expected_response_code); @@ -1082,7 +1080,6 @@ TALER_TESTING_cmd_refresh_melt * request, see #5312. * * @param label command label - * @param exchange connection to the exchange * @param amount FIXME not used. * @param coin_reference reference to a command that will provide * a coin to refresh @@ -1093,7 +1090,6 @@ TALER_TESTING_cmd_refresh_melt struct TALER_TESTING_Command TALER_TESTING_cmd_refresh_melt_double (const char *label, - struct TALER_EXCHANGE_Handle *exchange, const char *amount, const char *coin_reference, 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 TALER_TESTING_cmd_refresh_reveal (const char *label, - struct TALER_EXCHANGE_Handle *exchange, const char *melt_reference, 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 TALER_TESTING_cmd_refresh_link (const char *label, - struct TALER_EXCHANGE_Handle *exchange, const char *reveal_reference, unsigned int expected_response_code); |