diff options
Diffstat (limited to 'src/testing/testing_api_helpers_bank.c')
-rw-r--r-- | src/testing/testing_api_helpers_bank.c | 88 |
1 files changed, 6 insertions, 82 deletions
diff --git a/src/testing/testing_api_helpers_bank.c b/src/testing/testing_api_helpers_bank.c index 6751f3f4d..a82bcbfe3 100644 --- a/src/testing/testing_api_helpers_bank.c +++ b/src/testing/testing_api_helpers_bank.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of TALER | 2 | This file is part of TALER |
3 | Copyright (C) 2018-2020 Taler Systems SA | 3 | Copyright (C) 2018-2021 Taler Systems SA |
4 | 4 | ||
5 | TALER is free software; you can redistribute it and/or modify | 5 | TALER is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as | 6 | it under the terms of the GNU General Public License as |
@@ -31,15 +31,6 @@ | |||
31 | do {GNUNET_break (0); return NULL; } while (0) | 31 | do {GNUNET_break (0); return NULL; } while (0) |
32 | 32 | ||
33 | 33 | ||
34 | /** | ||
35 | * Runs the Fakebank by guessing / extracting the portnumber | ||
36 | * from the base URL. | ||
37 | * | ||
38 | * @param bank_url bank's base URL. | ||
39 | * @param currency currency the bank uses | ||
40 | * @return the fakebank process handle, or NULL if any | ||
41 | * error occurs. | ||
42 | */ | ||
43 | struct TALER_FAKEBANK_Handle * | 34 | struct TALER_FAKEBANK_Handle * |
44 | TALER_TESTING_run_fakebank (const char *bank_url, | 35 | TALER_TESTING_run_fakebank (const char *bank_url, |
45 | const char *currency) | 36 | const char *currency) |
@@ -69,13 +60,6 @@ TALER_TESTING_run_fakebank (const char *bank_url, | |||
69 | } | 60 | } |
70 | 61 | ||
71 | 62 | ||
72 | /** | ||
73 | * Look for substring in a programs' name. | ||
74 | * | ||
75 | * @param prog program's name to look into | ||
76 | * @param marker chunk to find in @a prog | ||
77 | * @return #GNUNET_YES if @a marker is present, otherwise #GNUNET_NO | ||
78 | */ | ||
79 | int | 63 | int |
80 | TALER_TESTING_has_in_name (const char *prog, | 64 | TALER_TESTING_has_in_name (const char *prog, |
81 | const char *marker) | 65 | const char *marker) |
@@ -100,16 +84,6 @@ TALER_TESTING_has_in_name (const char *prog, | |||
100 | } | 84 | } |
101 | 85 | ||
102 | 86 | ||
103 | /** | ||
104 | * Start the (nexus) bank process. Assume the port | ||
105 | * is available and the database is clean. Use the "prepare | ||
106 | * bank" function to do such tasks. This function is also | ||
107 | * responsible to create the exchange user at Nexus. | ||
108 | * | ||
109 | * @param bc bank configuration of the bank | ||
110 | * @return the pair of both service handles. In case of | ||
111 | * errors, each element of the pair will be set to NULL. | ||
112 | */ | ||
113 | struct TALER_TESTING_LibeufinServices | 87 | struct TALER_TESTING_LibeufinServices |
114 | TALER_TESTING_run_libeufin (const struct TALER_TESTING_BankConfiguration *bc) | 88 | TALER_TESTING_run_libeufin (const struct TALER_TESTING_BankConfiguration *bc) |
115 | { | 89 | { |
@@ -224,17 +198,6 @@ TALER_TESTING_run_libeufin (const struct TALER_TESTING_BankConfiguration *bc) | |||
224 | } | 198 | } |
225 | 199 | ||
226 | 200 | ||
227 | /** | ||
228 | * Start the (Python) bank process. Assume the port | ||
229 | * is available and the database is clean. Use the "prepare | ||
230 | * bank" function to do such tasks. | ||
231 | * | ||
232 | * @param config_filename configuration filename. | ||
233 | * @param bank_url base URL of the bank, used by `wget' to check | ||
234 | * that the bank was started right. | ||
235 | * @return the process, or NULL if the process could not | ||
236 | * be started. | ||
237 | */ | ||
238 | struct GNUNET_OS_Process * | 201 | struct GNUNET_OS_Process * |
239 | TALER_TESTING_run_bank (const char *config_filename, | 202 | TALER_TESTING_run_bank (const char *config_filename, |
240 | const char *bank_url) | 203 | const char *bank_url) |
@@ -318,17 +281,6 @@ TALER_TESTING_run_bank (const char *config_filename, | |||
318 | } | 281 | } |
319 | 282 | ||
320 | 283 | ||
321 | /** | ||
322 | * Prepare the Nexus execution. Check if the port is available | ||
323 | * and delete old database. | ||
324 | * | ||
325 | * @param config_filename configuration file name. | ||
326 | * @param reset_db should we reset the bank's database | ||
327 | * @param config_section section of the configuration with the exchange's account | ||
328 | * @param[out] bc set to the bank's configuration data | ||
329 | * @return the base url, or NULL upon errors. Must be freed | ||
330 | * by the caller. | ||
331 | */ | ||
332 | int | 284 | int |
333 | TALER_TESTING_prepare_nexus (const char *config_filename, | 285 | TALER_TESTING_prepare_nexus (const char *config_filename, |
334 | int reset_db, | 286 | int reset_db, |
@@ -434,17 +386,6 @@ TALER_TESTING_prepare_nexus (const char *config_filename, | |||
434 | } | 386 | } |
435 | 387 | ||
436 | 388 | ||
437 | /** | ||
438 | * Prepare the bank execution. Check if the port is available | ||
439 | * and reset database. | ||
440 | * | ||
441 | * @param config_filename configuration file name. | ||
442 | * @param reset_db should we reset the bank's database | ||
443 | * @param config_section section of the configuration with the exchange's account | ||
444 | * @param[out] bc set to the bank's configuration data | ||
445 | * @return the base url, or NULL upon errors. Must be freed | ||
446 | * by the caller. | ||
447 | */ | ||
448 | int | 389 | int |
449 | TALER_TESTING_prepare_bank (const char *config_filename, | 390 | TALER_TESTING_prepare_bank (const char *config_filename, |
450 | int reset_db, | 391 | int reset_db, |
@@ -611,16 +552,6 @@ TALER_TESTING_prepare_bank (const char *config_filename, | |||
611 | } | 552 | } |
612 | 553 | ||
613 | 554 | ||
614 | /** | ||
615 | * Prepare launching a fakebank. Check that the configuration | ||
616 | * file has the right option, and that the port is available. | ||
617 | * If everything is OK, return the configuration data of the fakebank. | ||
618 | * | ||
619 | * @param config_filename configuration file to use | ||
620 | * @param config_section which account to use (must match x-taler-bank) | ||
621 | * @param[out] bc set to the bank's configuration data | ||
622 | * @return #GNUNET_OK on success | ||
623 | */ | ||
624 | int | 555 | int |
625 | TALER_TESTING_prepare_fakebank (const char *config_filename, | 556 | TALER_TESTING_prepare_fakebank (const char *config_filename, |
626 | const char *config_section, | 557 | const char *config_section, |
@@ -706,21 +637,14 @@ TALER_TESTING_prepare_fakebank (const char *config_filename, | |||
706 | } | 637 | } |
707 | 638 | ||
708 | 639 | ||
709 | /** | ||
710 | * Allocate and return a piece of wire-details. Combines | ||
711 | * a @a payto -URL and adds some salt to create the JSON. | ||
712 | * | ||
713 | * @param payto payto://-URL to encapsulate | ||
714 | * @return JSON describing the account, including the | ||
715 | * payto://-URL of the account, must be manually decref'd | ||
716 | */ | ||
717 | json_t * | 640 | json_t * |
718 | TALER_TESTING_make_wire_details (const char *payto) | 641 | TALER_TESTING_make_wire_details (const char *payto) |
719 | { | 642 | { |
720 | return json_pack ("{s:s, s:s}", | 643 | return GNUNET_JSON_PACK ( |
721 | "payto_uri", payto, | 644 | GNUNET_JSON_pack_string ("payto_uri", |
722 | "salt", | 645 | payto), |
723 | "test-salt (must be constant for aggregation tests)"); | 646 | GNUNET_JSON_pack_string ("salt", |
647 | "test-salt (must be constant for aggregation tests)")); | ||
724 | } | 648 | } |
725 | 649 | ||
726 | 650 | ||