gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated: addressing FIXME_MA


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: addressing FIXME_MARCELLOs.
Date: Wed, 16 May 2018 14:31:02 +0200

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

marcello pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 1d62aeb  addressing FIXME_MARCELLOs.
1d62aeb is described below

commit 1d62aeb1991cd886732646ab5810a91afdc8f1ce
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed May 16 14:30:38 2018 +0200

    addressing FIXME_MARCELLOs.
---
 src/lib/Makefile.am                    |  4 +--
 src/lib/test_merchant_api.conf         |  2 +-
 src/lib/test_merchant_api_twisted.c    | 20 +++++---------
 src/lib/test_merchant_api_twisted.conf |  9 ++++---
 src/lib/testing_api_cmd_track.c        | 48 ++++++++++++++++++----------------
 5 files changed, 39 insertions(+), 44 deletions(-)

diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 6e88568..c96ead5 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -79,11 +79,9 @@ check_PROGRAMS = \
   test_merchant_api_new \
   test_merchant_api
 
-if HAVE_EXPERIMENTAL
 if HAVE_TWISTER
 # See FIXME_MARCELLO -- had some issues (FTBFS, etc.)
-#  check_PROGRAMS += test_merchant_api_twisted
-endif
+check_PROGRAMS += test_merchant_api_twisted
 endif
 
 endif
diff --git a/src/lib/test_merchant_api.conf b/src/lib/test_merchant_api.conf
index 32039c0..7f1d086 100644
--- a/src/lib/test_merchant_api.conf
+++ b/src/lib/test_merchant_api.conf
@@ -112,8 +112,8 @@ ACTIVE_dtip = YES
 # (by the merchant)
 [exchange-kudos]
 MASTER_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
-BASE_URL = "http://localhost:8081/";
 CURRENCY = KUDOS
+URL = http://localhost:8081/
 
 
 # Auditors must be in sections "auditor-", the rest of the section
diff --git a/src/lib/test_merchant_api_twisted.c 
b/src/lib/test_merchant_api_twisted.c
index 5ff2109..6417b71 100644
--- a/src/lib/test_merchant_api_twisted.c
+++ b/src/lib/test_merchant_api_twisted.c
@@ -546,12 +546,10 @@ run (void *cls,
                                      MHD_HTTP_OK,
                                      "create-proposal-6",
                                      GNUNET_YES),
-
     CMD_EXEC_AGGREGATOR ("run-aggregator"),
-
     TALER_TESTING_cmd_check_bank_transfer
       ("check_bank_transfer-1",
-       twister_exchange_url,
+       twister_exchange_url, /* has the 8888-port thing.  */
        /* paid,         1.97 =
           brutto        2.00 -
           deposit fee   0.01 * 2 -
@@ -561,16 +559,13 @@ run (void *cls,
        EXCHANGE_ACCOUNT_NO,
        MERCHANT_ACCOUNT_NO),
 
-    /* Should instead change the response body somehow! */
     TALER_TESTING_cmd_modify_object ("hack-0",
                                      PROXY_EXCHANGE_CONFIG_FILE,
                                      "total",
                                      "EUR:0.98"),
-
     TALER_TESTING_cmd_delete_object ("hack-1",
                                      PROXY_EXCHANGE_CONFIG_FILE,
                                      "deposits.0"),
-
     TALER_TESTING_cmd_merchant_track_transaction
       ("track-transaction-1",
        twister_merchant_url,
@@ -678,20 +673,18 @@ run (void *cls,
                                  "deposit-simple-for-abort",
                                  is->ctx,
                                  0),
-#if FIXME_MARCELLO
-    TALER_TESTING_cmd_flip_object
+
+    TALER_TESTING_cmd_flip_download
       ("hack-abort-4",
        PROXY_MERCHANT_CONFIG_FILE,
        "refund_permissions.0.merchant_sig"),
-#endif
+
     TALER_TESTING_cmd_pay_abort ("pay-abort-4",
                                  twister_merchant_url,
                                  "deposit-simple-for-abort",
                                  is->ctx,
                                  0),
-
     /* just malforming the response.  */
-
     TALER_TESTING_cmd_malform_response
       ("malform-abortion",
        PROXY_MERCHANT_CONFIG_FILE),
@@ -766,12 +759,11 @@ run (void *cls,
                            "EUR:1.99", // no sense now
                            "EUR:0.01"), // no sense now
 
-#if FIXME_MARCELLO
-    TALER_TESTING_cmd_flip_object
+    TALER_TESTING_cmd_flip_download
       ("hack-coin-history",
        PROXY_MERCHANT_CONFIG_FILE,
        "history.0.coin_sig"),
-#endif
+
     /* Coin history check will fail, due to coin's bad signature.  */
     TALER_TESTING_cmd_pay ("deposit-simple-fail",
                            twister_merchant_url,
diff --git a/src/lib/test_merchant_api_twisted.conf 
b/src/lib/test_merchant_api_twisted.conf
index f08fc12..36b196a 100644
--- a/src/lib/test_merchant_api_twisted.conf
+++ b/src/lib/test_merchant_api_twisted.conf
@@ -5,8 +5,11 @@
 # must target the twister's http port.
 URL = http://localhost:8888/
 
+[exchange]
+BASE_URL = http://localhost:8888/
+
 # merchant: 8080
 # exchange: 8081
-# bank: 8082
-# twisted-merchant: 8888
-# twisted-control: 8889
+# (Fake)bank: 8082
+# twisted-exchange: 8888
+# twisted-merchant: 8889
diff --git a/src/lib/testing_api_cmd_track.c b/src/lib/testing_api_cmd_track.c
index 18e5a5f..f58ed16 100644
--- a/src/lib/testing_api_cmd_track.c
+++ b/src/lib/testing_api_cmd_track.c
@@ -121,30 +121,32 @@ track_transaction_cb (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "/track/transaction, response code: %u\n",
               http_status);
-
-  /* Only storing first element's wtid, as this works around
-   * the disability of the real bank to provide a "bank check"
-   * CMD as the fakebank does.  */
-  if (NULL == (wtid_str = json_object_get
-    (json_array_get (json, 0), "wtid")))
-  {
-    TALER_TESTING_interpreter_fail (tts->is);
-    return; 
-  }
-
-  if (NULL == (exchange_url = json_object_get
-    (json_array_get (json, 0), "exchange")))
+  if (MHD_HTTP_OK == http_status)
   {
+    /* Only storing first element's wtid, as this works around
+     * the disability of the real bank to provide a "bank check"
+     * CMD as the fakebank does.  */
   
-    TALER_TESTING_interpreter_fail (tts->is);
-    return;
+    if (NULL == (wtid_str = json_object_get
+      (json_array_get (json, 0), "wtid")))
+    {
+      TALER_TESTING_interpreter_fail (tts->is);
+      return; 
+    }
+  
+    if (NULL == (exchange_url = json_object_get
+      (json_array_get (json, 0), "exchange")))
+    {
+    
+      TALER_TESTING_interpreter_fail (tts->is);
+      return;
+    }
+  
+    tts->exchange_url = GNUNET_strdup
+      (json_string_value (exchange_url));
+    tts->wtid_str = GNUNET_strdup
+      (json_string_value (wtid_str));
   }
-
-  tts->exchange_url = GNUNET_strdup
-    (json_string_value (exchange_url));
-  tts->wtid_str = GNUNET_strdup
-    (json_string_value (wtid_str));
-
   TALER_TESTING_interpreter_next (tts->is);
 }
 
@@ -333,8 +335,8 @@ track_transaction_cleanup (void *cls,
   }
 
   /* Need to discard 'const' before freeing.  */
-  GNUNET_free ((char *) tts->exchange_url);
-  GNUNET_free ((char *) tts->wtid_str);
+  GNUNET_free_non_null ((char *) tts->exchange_url);
+  GNUNET_free_non_null ((char *) tts->wtid_str);
 
   GNUNET_free (tts);
 }

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



reply via email to

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