gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated: make twister test case compile,


From: gnunet
Subject: [taler-merchant] branch master updated: make twister test case compile, won't work yet
Date: Sun, 19 Jan 2020 14:06:15 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new ebe5795  make twister test case compile, won't work yet
ebe5795 is described below

commit ebe5795ab75c7c7006e34f6a1d6f5761a608a7c1
Author: Florian Dold <address@hidden>
AuthorDate: Sun Jan 19 14:06:10 2020 +0100

    make twister test case compile, won't work yet
---
 src/lib/test_merchant_api_twisted.c | 96 +++++++++++++++----------------------
 1 file changed, 39 insertions(+), 57 deletions(-)

diff --git a/src/lib/test_merchant_api_twisted.c 
b/src/lib/test_merchant_api_twisted.c
index 0e5120e..d9dd576 100644
--- a/src/lib/test_merchant_api_twisted.c
+++ b/src/lib/test_merchant_api_twisted.c
@@ -23,6 +23,7 @@
  * @author Sree Harsha Totakura <address@hidden>
  * @author Christian Grothoff
  * @author Marcello Stanisci
+ * @author Florian Dold <address@hidden>
  */
 
 #include "platform.h"
@@ -45,6 +46,22 @@
  */
 #define CONFIG_FILE "test_merchant_api_twisted.conf"
 
+/**
+ * Account number of the exchange at the bank.
+ */
+#define EXCHANGE_ACCOUNT_NAME "2"
+
+/**
+ * Account number of the merchant at the bank.
+ */
+#define MERCHANT_ACCOUNT_NAME "3"
+
+/**
+ * Account number of some user.
+ */
+#define USER_ACCOUNT_NAME "62"
+
+
 /**
  * Configuration file for the proxy between merchant and
  * exchange.  Not used directly here in the code (instead
@@ -95,11 +112,6 @@ static char *fakebank_url;
  */
 static char *merchant_url;
 
-/**
- * Exchange base URL.
- */
-static char *exchange_url;
-
 /**
  * Merchant process.
  */
@@ -116,30 +128,12 @@ static struct GNUNET_OS_Process *twisterexchanged;
 static struct GNUNET_OS_Process *twistermerchantd;
 
 
-static char *payer_url;
 static char *payer_payto;
 static char *exchange_payto;
 static char *merchant_payto;
-static struct TALER_BANK_AuthenticationData auth;
-static struct TALER_WireTransferIdentifierRawP wtid;
 static struct TALER_TESTING_BankConfiguration bc;
 static struct TALER_TESTING_ExchangeConfiguration ec;
 
-/**
- * Account number of the exchange at the bank.
- */
-#define EXCHANGE_ACCOUNT_PATH "/2"
-
-/**
- * Account number of the merchant at the bank.
- */
-#define MERCHANT_ACCOUNT_PATH "/3"
-
-/**
- * Account number of some user.
- */
-#define USER_ACCOUNT_PATH "/62"
-
 /**
  * User name. Never checked by fakebank.
  */
@@ -156,8 +150,12 @@ static struct TALER_TESTING_ExchangeConfiguration ec;
  *
  * @param label label to use for the command.
  */
-#define CMD_EXEC_WIREWATCH(label) \
-  TALER_TESTING_cmd_exec_wirewatch (label, CONFIG_FILE)
+static struct TALER_TESTING_Command
+CMD_EXEC_WIREWATCH (const char *label)
+{
+  return TALER_TESTING_cmd_exec_wirewatch (label, CONFIG_FILE);
+}
+
 
 /**
  * Execute the taler-exchange-aggregator command with
@@ -165,8 +163,11 @@ static struct TALER_TESTING_ExchangeConfiguration ec;
  *
  * @param label label to use for the command.
  */
-#define CMD_EXEC_AGGREGATOR(label) \
-  TALER_TESTING_cmd_exec_aggregator (label, CONFIG_FILE)
+static struct TALER_TESTING_Command
+CMD_EXEC_AGGREGATOR (const char *label)
+{
+  return TALER_TESTING_cmd_exec_aggregator (label, CONFIG_FILE);
+}
 
 
 /**
@@ -177,26 +178,15 @@ static struct TALER_TESTING_ExchangeConfiguration ec;
  * @param amount amount to transfer, i.e. "EUR:1"
  * @param url exchange_url
  */
-#define CMD_TRANSFER_TO_EXCHANGE(label,amount) \
-  TALER_TESTING_cmd_transfer (label, amount, \
-                              payer_url, \
-                              &auth, \
-                              exchange_payto, \
-                              &wtid, \
-                              EXCHANGE_URL)
+static struct TALER_TESTING_Command
+CMD_TRANSFER_TO_EXCHANGE (const char *label, const char *amount)
+{
+  return TALER_TESTING_cmd_admin_add_incoming (label,
+                                               amount,
+                                               &bc.exchange_auth,
+                                               payer_payto);
+}
 
-/**
- * Run wire transfer of funds from some user's account to the
- * exchange.
- *
- * @param label label to use for the command.
- * @param amount amount to transfer, i.e. "EUR:1"
- */
-#define CMD_TRANSFER_TO_EXCHANGE_SUBJECT(label,amount,subject) \
-  TALER_TESTING_cmd_fakebank_transfer_with_subject \
-    (label, amount, fakebank_url, USER_ACCOUNT_NO, \
-    EXCHANGE_ACCOUNT_NO, USER_LOGIN_NAME, USER_LOGIN_PASS, \
-    subject)
 
 /**
  * Main function that will tell the interpreter what commands to
@@ -1034,7 +1024,6 @@ run (void *cls,
     TALER_TESTING_cmd_end ()
   };
 
-
   TALER_TESTING_run_with_fakebank (is,
                                    commands,
                                    fakebank_url);
@@ -1072,16 +1061,9 @@ main (int argc,
     return 77;
 
 
-  exchange_payto = TALER_payto_xtalerbank_make (fakebank_url,
-                                                EXCHANGE_ACCOUNT_PATH);
-  payer_payto = TALER_payto_xtalerbank_make (fakebank_url,
-                                             USER_ACCOUNT_PATH);
-  merchant_payto = TALER_payto_xtalerbank_make (fakebank_url,
-                                                MERCHANT_ACCOUNT_PATH);
-  GNUNET_asprintf (&payer_url,
-                   "%s%s",
-                   fakebank_url,
-                   USER_ACCOUNT_PATH);
+  payer_payto = ("payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME);
+  exchange_payto = ("payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME);
+  merchant_payto = ("payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME);
 
   if (NULL == (merchant_url = TALER_TESTING_prepare_merchant
                                 (CONFIG_FILE)))

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]