summaryrefslogtreecommitdiff
path: root/src/include/taler_fakebank_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/taler_fakebank_lib.h')
-rw-r--r--src/include/taler_fakebank_lib.h35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/include/taler_fakebank_lib.h b/src/include/taler_fakebank_lib.h
index dc6ba1dac..6b34f4730 100644
--- a/src/include/taler_fakebank_lib.h
+++ b/src/include/taler_fakebank_lib.h
@@ -76,6 +76,35 @@ TALER_FAKEBANK_start2 (uint16_t port,
/**
+ * 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 hostname hostname to use in URLs and URIs.
+ * @param port port to listen to
+ * @param exchange_url suggested exchange base URL
+ * @param currency which currency should the bank offer
+ * @param ram_limit how much memory do we use at most
+ * @param num_threads size of the thread pool, 0 to use the GNUnet scheduler
+ * @param signup_bonus how much to credit new users
+ * @return NULL on error
+ */
+struct TALER_FAKEBANK_Handle *
+TALER_FAKEBANK_start3 (const char *hostname,
+ uint16_t port,
+ const char *exchange_url,
+ const char *currency,
+ uint64_t ram_limit,
+ unsigned int num_threads,
+ const struct TALER_Amount *signup_bonus);
+
+
+/**
* Check that no wire transfers were ordered (or at least none
* that have not been taken care of via #TALER_FAKEBANK_check_debit()
* or #TALER_FAKEBANK_check_credit()).
@@ -87,7 +116,7 @@ TALER_FAKEBANK_start2 (uint16_t port,
* @param h bank instance
* @return #GNUNET_OK on success
*/
-int
+enum GNUNET_GenericReturnValue
TALER_FAKEBANK_check_empty (struct TALER_FAKEBANK_Handle *h);
@@ -109,7 +138,7 @@ TALER_FAKEBANK_check_empty (struct TALER_FAKEBANK_Handle *h);
* @param[out] wtid set to the wire transfer identifier
* @return #GNUNET_OK on success
*/
-int
+enum GNUNET_GenericReturnValue
TALER_FAKEBANK_check_debit (struct TALER_FAKEBANK_Handle *h,
const struct TALER_Amount *want_amount,
const char *want_debit,
@@ -133,7 +162,7 @@ TALER_FAKEBANK_check_debit (struct TALER_FAKEBANK_Handle *h,
* @param reserve_pub reserve public key expected in wire subject
* @return #GNUNET_OK on success
*/
-int
+enum GNUNET_GenericReturnValue
TALER_FAKEBANK_check_credit (struct TALER_FAKEBANK_Handle *h,
const struct TALER_Amount *want_amount,
const char *want_debit,