summaryrefslogtreecommitdiff
path: root/src/include/taler_testing_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-04-02 14:24:45 +0200
committerChristian Grothoff <christian@grothoff.org>2018-04-02 14:29:44 +0200
commitcb55c1a3af9f56a6da38e5589e72df0b70d355b1 (patch)
tree5f9a3af7d9073249f77ce56c690844a6cb27c3e7 /src/include/taler_testing_lib.h
parent7a20062bafed42f937c5388aed09042aad7014c0 (diff)
downloadexchange-cb55c1a3af9f56a6da38e5589e72df0b70d355b1.tar.gz
exchange-cb55c1a3af9f56a6da38e5589e72df0b70d355b1.tar.bz2
exchange-cb55c1a3af9f56a6da38e5589e72df0b70d355b1.zip
Changing configuration structure to enable multiple accounts.
This change enables using multiple wire plugins at the same time. Also, we now distinguish between the wire plugin (i.e. EBICS or taler_bank) and the wire method (i.e. SEPA or x-taler-bank) that the wire plugin is implementing. The "taler-bank" wire method was renamed from "test" to "x-taler-bank". This also changes the format of the /wire response of the exchange, as we now need to return multiple accounts. Note that wire fees are specified per wire method, not per wire account. taler-exchange-keyup now automatically signs all of the /wire responses in the location specified by the configuration. Account identification in wire plugins was changed to use payto://-URLs instead of method-specific JSON fields. Signing and validation of /wire responses was moved from each wire plugin to a generic validation method in libtalerutil (crypto) or libtalerjson (for JSON-formatted inputs). Convenience methods were added to generate JSON for wire accounts (salting, signing). Various section and option names were adjusted to streamline the configuration and make it more consistent overall. Documentation was updated as well.
Diffstat (limited to 'src/include/taler_testing_lib.h')
-rw-r--r--src/include/taler_testing_lib.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index 3914208f1..dce92ceae 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -66,20 +66,22 @@
#define TALER_TESTING_MAKE_TRAIT_ROW_ID(data) \
TALER_TESTING_make_trait_uint64 (3, data)
+
/**
- * Allocate and return a piece of wire-details. Mostly, it adds
- * the bank_url to the JSON.
+ * Allocate and return a piece of wire-details. Combines
+ * the @a account_no and the @a bank_url to a
+ * @a payto://-URL and adds some salt to create the JSON.
*
- * @param template the wire-details template.
+ * @param account_no account number
* @param bank_url the bank_url
- *
- * @return the filled out and stringified wire-details. To
- * be manually free'd.
+ * @return JSON describing the account, including the
+ * payto://-URL of the account, must be manually decref'd
*/
-char *
-TALER_TESTING_make_wire_details (const char *template,
+json_t *
+TALER_TESTING_make_wire_details (unsigned long long account_no,
const char *bank_url);
+
/**
* Find denomination key matching the given amount.
*
@@ -130,10 +132,12 @@ TALER_TESTING_url_port_free (const char *url);
* If everything is OK, return the configured URL of the fakebank.
*
* @param config_filename configuration file to use
+ * @param config_section which account to use (must match x-taler-bank)
* @return NULL on error, fakebank URL otherwise
*/
char *
-TALER_TESTING_prepare_fakebank (const char *config_filename);
+TALER_TESTING_prepare_fakebank (const char *config_filename,
+ const char *config_section);
/* ******************* Generic interpreter logic ************ */
@@ -613,8 +617,8 @@ TALER_TESTING_cmd_status (const char *label,
* coins, this parameter selects which one in that array
* This value is currently ignored, as only one-coin
* withdrawals are implemented.
- * @param wire_details bank details of the merchant performing the
- * deposit
+ * @param wire_details JSON including payto://-URL of the merchant performing the
+ * deposit, reference is captured by this command
* @param contract_terms contract terms to be signed over by the
* coin
* @param refund_deadline refund deadline
@@ -625,12 +629,12 @@ TALER_TESTING_cmd_status (const char *label,
* @return the deposit command to be run by the interpreter
*/
struct TALER_TESTING_Command
-TALER_TESTING_cmd_deposit
+TALER_TESTING_cmd_deposit
(const char *label,
struct TALER_EXCHANGE_Handle *exchange,
const char *coin_reference,
unsigned int coin_index,
- char *wire_details,
+ json_t *wire_details,
const char *contract_terms,
struct GNUNET_TIME_Relative refund_deadline,
const char *amount,
@@ -1209,7 +1213,7 @@ int
TALER_TESTING_get_trait_wire_details
(const struct TALER_TESTING_Command *cmd,
unsigned int index,
- const char **wire_details);
+ const json_t **wire_details);
/**
@@ -1223,7 +1227,7 @@ TALER_TESTING_get_trait_wire_details
struct TALER_TESTING_Trait
TALER_TESTING_make_trait_wire_details
(unsigned int index,
- const char *wire_details);
+ const json_t *wire_details);
/**
* Obtain a private key from a "peer". Used e.g. to obtain
@@ -1300,11 +1304,11 @@ TALER_TESTING_get_trait_transfer_subject
/**
- * Offer wire details in a trait.
+ * Offer wire wire transfer subject in a trait.
*
* @param index always (?) zero, as one command sticks
* to one bank account
- * @param wire_details wire details to offer
+ * @param transfer_subject wire transfer subject to offer
* @return the trait, to be put in the traits array of the command
*/
struct TALER_TESTING_Trait