From 036e7117798246b04fb5d8cbf274abf3b04ddbd3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 19 Jun 2021 05:00:45 +0200 Subject: extend fakebank API to have thread pool option --- src/include/taler_fakebank_lib.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/include/taler_fakebank_lib.h') diff --git a/src/include/taler_fakebank_lib.h b/src/include/taler_fakebank_lib.h index abef2de52..828282c8b 100644 --- a/src/include/taler_fakebank_lib.h +++ b/src/include/taler_fakebank_lib.h @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2016-2020 Taler Systems SA + (C) 2016-2021 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 the Free Software @@ -52,6 +52,29 @@ TALER_FAKEBANK_start (uint16_t port, const char *currency); +/** + * Start the fake bank. The fake bank will, like the normal bank, listen for + * requests for /admin/add/incoming and /transfer. However, instead of + * executing or storing those requests, it will simply allow querying whether + * such a request has been made via #TALER_FAKEBANK_check_debit() and + * #TALER_FAKEBANK_check_credit() as well as the history API. + * + * This is useful for writing testcases to check whether the exchange + * would have issued the correct wire transfer orders. + * + * @param port port to listen to + * @param currency which currency should the bank offer + * @param num_threads size of the thread pool, 0 to use the GNUnet scheduler + * @param close_connections true to force closing a connection after each request (no HTTP keep-alive) + * @return NULL on error + */ +struct TALER_FAKEBANK_Handle * +TALER_FAKEBANK_start2 (uint16_t port, + const char *currency, + unsigned int num_threads, + bool close_connections); + + /** * Check that no wire transfers were ordered (or at least none * that have not been taken care of via #TALER_FAKEBANK_check_debit() -- cgit v1.2.3