From 1fc9595b2c66ac1b2af21c88f22d086defc8be57 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Wed, 4 Sep 2019 15:01:31 +0200 Subject: Calling bank legacy API in a test --- .../test_wire_plugin_transactions_taler-bank.c | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/wire-plugins/test_wire_plugin_transactions_taler-bank.c') diff --git a/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c b/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c index 304890dcb..3d7fa76e0 100644 --- a/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c +++ b/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c @@ -78,6 +78,11 @@ static struct TALER_FAKEBANK_Handle *fb; */ static struct TALER_WIRE_HistoryHandle *hh; +/** + * Handle to the history-range request (the "legacy" bank API). + */ +static struct TALER_WIRE_HistoryHandle *hhr; + /** * Handle for the timeout task. */ @@ -122,6 +127,14 @@ do_shutdown (void *cls) hh); hh = NULL; } + + if (NULL != hhr) + { + plugin->get_history_cancel (plugin->cls, + hhr); + hhr = NULL; + } + if (NULL != tt) { GNUNET_SCHEDULER_cancel (tt); @@ -256,10 +269,21 @@ confirmation_cb (void *cls, hh = plugin->get_history (plugin->cls, my_account, TALER_BANK_DIRECTION_BOTH, - NULL, 0, + NULL, + 0, 5, &history_result_cb, NULL); + + GNUNET_assert + (NULL != (hhr = plugin->get_history_range + (plugin->cls, + my_account, + TALER_BANK_DIRECTION_BOTH, + GNUNET_TIME_UNIT_ZERO_ABS, + GNUNET_TIME_UNIT_FOREVER_ABS, + &history_result_cb, + NULL))); } @@ -328,6 +352,7 @@ int main (int argc, const char *const argv[]) { + GNUNET_log_setup ("test-wire-plugin-transactions-test", "WARNING", NULL); -- cgit v1.2.3