summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-15 13:22:28 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-15 13:22:37 +0100
commit8a3f0e3f8d998d1badc9767fb207e7a07d645150 (patch)
tree5218909386830dcd800d277cf9243be455571376 /src/include
parente77ccd03906bd2db068136bb383976f714b3289e (diff)
downloadexchange-8a3f0e3f8d998d1badc9767fb207e7a07d645150.tar.gz
exchange-8a3f0e3f8d998d1badc9767fb207e7a07d645150.tar.bz2
exchange-8a3f0e3f8d998d1badc9767fb207e7a07d645150.zip
clean up payto credit/debit distincition
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_testing_lib.h48
1 files changed, 27 insertions, 21 deletions
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index 9499526af..7e097ff13 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -49,30 +49,15 @@
} while (0)
+// FIXME: replace these
#define TALER_TESTING_GET_TRAIT_ROW_ID(cmd,out) \
TALER_TESTING_get_trait_uint64 (cmd, 3, out)
+// FIXME: replace these
#define TALER_TESTING_MAKE_TRAIT_ROW_ID(data) \
TALER_TESTING_make_trait_uint64 (3, data)
-// FIXME: replace these!
-#define TALER_TESTING_GET_TRAIT_CREDIT_ACCOUNT(cmd,out) \
- TALER_TESTING_get_trait_string (cmd, 4, out)
-
-// FIXME: replace these!
-#define TALER_TESTING_MAKE_TRAIT_CREDIT_ACCOUNT(data) \
- TALER_TESTING_make_trait_string (4, data)
-
-// FIXME: replace these!
-#define TALER_TESTING_GET_TRAIT_DEBIT_ACCOUNT(cmd,out) \
- TALER_TESTING_get_trait_string (cmd, 5, out)
-
-// FIXME: replace these!
-#define TALER_TESTING_MAKE_TRAIT_DEBIT_ACCOUNT(data) \
- TALER_TESTING_make_trait_string (5, data)
-
-
/**
* Allocate and return a piece of wire-details. Combines
* a @a payto -URL and adds some salt to create the JSON.
@@ -2358,15 +2343,36 @@ TALER_TESTING_get_trait_url (const struct TALER_TESTING_Command *cmd,
/**
+ * Used as the "index" in payto traits, to identify what kind of
+ * payto URL we are returning.
+ */
+enum TALER_TESTING_PaytoType
+{
+ /**
+ * We don't know / not credit or debit.
+ */
+ TALER_TESTING_PT_NEUTRAL,
+ /**
+ * Credit side of a transaction.
+ */
+ TALER_TESTING_PT_CREDIT,
+ /**
+ * Debit side of a transaction.
+ */
+ TALER_TESTING_PT_DEBIT
+};
+
+
+/**
* Offer PAYTO url in a trait.
*
- * @param index which url is to be picked,
+ * @param pt which url is to be picked,
* in case multiple are offered.
* @param url the url to offer.
* @return the trait.
*/
struct TALER_TESTING_Trait
-TALER_TESTING_make_trait_payto (unsigned int index,
+TALER_TESTING_make_trait_payto (enum TALER_TESTING_PaytoType pt,
const char *url);
@@ -2374,14 +2380,14 @@ TALER_TESTING_make_trait_payto (unsigned int index,
* Obtain a PAYTO url from @a cmd.
*
* @param cmd command to extract the url from.
- * @param index which url is to be picked, in case
+ * @param pt which url is to be picked, in case
* multiple are offered.
* @param url[out] where to write the url.
* @return #GNUNET_OK on success.
*/
int
TALER_TESTING_get_trait_payto (const struct TALER_TESTING_Command *cmd,
- unsigned int index,
+ enum TALER_TESTING_PaytoType pt,
const char **url);