gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: DCE: only keep x-taler-wire proc


From: gnunet
Subject: [taler-exchange] branch master updated: DCE: only keep x-taler-wire processing functions we actually use/need
Date: Sat, 18 Jan 2020 01:13:58 +0100

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

dold pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new d2d7791c DCE: only keep x-taler-wire processing functions we actually 
use/need
d2d7791c is described below

commit d2d7791c698cee7912fc054660cced40ff2171de
Author: Florian Dold <address@hidden>
AuthorDate: Sat Jan 18 01:13:53 2020 +0100

    DCE: only keep x-taler-wire processing functions we actually use/need
---
 src/include/taler_util.h                          |  35 -----
 src/lib/testing_api_cmd_bank_admin_add_incoming.c |  11 +-
 src/util/test_payto.c                             |  35 -----
 src/util/util.c                                   | 149 ----------------------
 4 files changed, 2 insertions(+), 228 deletions(-)

diff --git a/src/include/taler_util.h b/src/include/taler_util.h
index 37b6765a..335b123c 100644
--- a/src/include/taler_util.h
+++ b/src/include/taler_util.h
@@ -245,41 +245,6 @@ char *
 TALER_payto_get_method (const char *payto_url);
 
 
-/**
- * Create an x-taler-bank payto:// URL from a @a bank_url
- * and an @a account_name.
- *
- * @param bank_url the bank URL
- * @param account_name the account name
- * @return payto:// URL
- */
-char *
-TALER_payto_xtalerbank_make (const char *bank_url,
-                             const char *account_name);
-
-
-/**
- * Create an x-taler-bank payto:// URL from an @a account_url.
- *
- * @param account_url the bank URL
- * @param account_name the account name
- * @return payto:// URL
- */
-char *
-TALER_payto_xtalerbank_make2 (const char *account_url);
-
-
-/**
- * Given an x-taler-bank payto:// URL, compute
- * the HTTP(S) base URL of the account.
- *
- * @param payto the payto URL
- * @return bank URL of the account, NULL if not x-taler-bak payto URL
- */
-char *
-TALER_xtalerbank_base_url_from_payto (const char *payto);
-
-
 /**
  * Obtain the account name from a payto URL.
  *
diff --git a/src/lib/testing_api_cmd_bank_admin_add_incoming.c 
b/src/lib/testing_api_cmd_bank_admin_add_incoming.c
index c59ef85f..2e274fbc 100644
--- a/src/lib/testing_api_cmd_bank_admin_add_incoming.c
+++ b/src/lib/testing_api_cmd_bank_admin_add_incoming.c
@@ -58,11 +58,6 @@ struct AdminAddIncomingState
    */
   const char *payto_debit_account;
 
-  /**
-   * Money receiver payto URL.
-   */
-  char *payto_credit_account;
-
   /**
    * Username to use for authentication.
    */
@@ -381,7 +376,6 @@ admin_add_incoming_cleanup (void *cls,
     GNUNET_SCHEDULER_cancel (fts->retry_task);
     fts->retry_task = NULL;
   }
-  GNUNET_free (fts->payto_credit_account);
   GNUNET_free (fts);
 }
 
@@ -407,8 +401,9 @@ admin_add_incoming_traits (void *cls,
     TALER_TESTING_make_trait_bank_row (&fts->serial_id),
     TALER_TESTING_make_trait_payto (TALER_TESTING_PT_DEBIT,
                                     fts->payto_debit_account),
+    /* Used as a marker, content does not matter */
     TALER_TESTING_make_trait_payto (TALER_TESTING_PT_CREDIT,
-                                    fts->payto_credit_account),
+                                    "payto://void/the-exchange"),
     TALER_TESTING_make_trait_url (TALER_TESTING_UT_EXCHANGE_BANK_ACCOUNT_URL,
                                   fts->exchange_credit_url),
     TALER_TESTING_make_trait_amount_obj (0, &fts->amount),
@@ -447,8 +442,6 @@ make_fts (const char *amount,
   fts = GNUNET_new (struct AdminAddIncomingState);
   fts->exchange_credit_url = exchange_base_url;
   fts->payto_debit_account = payto_debit_account;
-  fts->payto_credit_account
-    = TALER_payto_xtalerbank_make2 (exchange_base_url);
   fts->auth = *auth;
   if (GNUNET_OK !=
       TALER_string_to_amount (amount,
diff --git a/src/util/test_payto.c b/src/util/test_payto.c
index 5807be20..b7d73f80 100644
--- a/src/util/test_payto.c
+++ b/src/util/test_payto.c
@@ -42,41 +42,6 @@ main (int argc,
   GNUNET_log_setup ("test-payto",
                     "WARNING",
                     NULL);
-  r = TALER_payto_xtalerbank_make ("https://localhost/";,
-                                   "account");
-  CHECK ("payto://x-taler-bank/localhost/account",
-         r);
-  r = TALER_payto_xtalerbank_make ("https://localhost";,
-                                   "account");
-  CHECK ("payto://x-taler-bank/localhost/account",
-         r);
-  r = TALER_payto_xtalerbank_make2 ("https://localhost/account";);
-  CHECK ("payto://x-taler-bank/localhost/account",
-         r);
-  r = TALER_payto_xtalerbank_make ("http://localhost:80/";,
-                                   "account");
-  CHECK ("payto://x-taler-bank/localhost:80/account",
-         r);
-  r = TALER_payto_xtalerbank_make ("http://localhost:80";,
-                                   "account");
-  CHECK ("payto://x-taler-bank/localhost:80/account",
-         r);
-  r = TALER_payto_xtalerbank_make ("http://localhost/";,
-                                   "account");
-  r = TALER_payto_xtalerbank_make2 ("http://localhost:80/account";);
-  CHECK ("payto://x-taler-bank/localhost:80/account",
-         r);
-  r = TALER_payto_xtalerbank_make2 ("http://localhost/account";);
-  CHECK ("payto://x-taler-bank/localhost:80/account",
-         r);
-  r = TALER_xtalerbank_base_url_from_payto (
-    "payto://x-taler-bank/localhost/bob");
-  CHECK ("https://localhost/";,
-         r);
-  r = TALER_xtalerbank_base_url_from_payto (
-    "payto://x-taler-bank/localhost:1080/bob");
-  CHECK ("http://localhost:1080/";,
-         r);
   r = TALER_xtalerbank_account_from_payto (
     "payto://x-taler-bank/localhost:1080/alice");
   CHECK ("alice",
diff --git a/src/util/util.c b/src/util/util.c
index 36c6f440..c9316462 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -570,155 +570,6 @@ TALER_payto_get_method (const char *payto_url)
 }
 
 
-/**
- * Create an x-taler-bank payto:// URL from a @a bank_url
- * and an @a account_name.
- *
- * @param bank_url the bank URL
- * @param account_name the account name
- * @return payto:// URL
- */
-char *
-TALER_payto_xtalerbank_make (const char *bank_url,
-                             const char *account_name)
-{
-  char *payto;
-  int plaintext;
-  const char *port;
-  size_t slen;
-
-  if (0 == strncasecmp ("https://";,
-                        bank_url,
-                        strlen ("https://";)))
-  {
-    bank_url += strlen ("https://";);
-    plaintext = GNUNET_NO;
-  }
-  else if (0 == strncasecmp ("http://";,
-                             bank_url,
-                             strlen ("http://";)))
-  {
-    bank_url += strlen ("http://";);
-    plaintext = GNUNET_YES;
-  }
-  else
-    return NULL;
-  slen = strlen (bank_url);
-  port = memchr (bank_url,
-                 ':',
-                 slen);
-  if ( (0 < slen) &&
-       ('/' == bank_url[slen - 1]) )
-    slen--;
-  GNUNET_asprintf (&payto,
-                   ( (NULL == port) && (GNUNET_YES == plaintext) )
-                   ? "payto://x-taler-bank/%.*s:80/%s"
-                   : "payto://x-taler-bank/%.*s/%s",
-                   (int) slen,
-                   bank_url,
-                   account_name);
-  return payto;
-}
-
-
-/**
- * Create an x-taler-bank payto:// URL from an @a account_url.
- *
- * @param account_url the bank URL
- * @param account_name the account name
- * @return payto:// URL
- */
-char *
-TALER_payto_xtalerbank_make2 (const char *account_url)
-{
-  char *payto;
-  int plaintext;
-  const char *port;
-  size_t slen;
-  const char *account;
-
-  if (0 == strncasecmp ("https://";,
-                        account_url,
-                        strlen ("https://";)))
-  {
-    account_url += strlen ("https://";);
-    plaintext = GNUNET_NO;
-  }
-  else if (0 == strncasecmp ("http://";,
-                             account_url,
-                             strlen ("http://";)))
-  {
-    account_url += strlen ("http://";);
-    plaintext = GNUNET_YES;
-  }
-  else
-    return NULL;
-  account = strchr (account_url,
-                    '/');
-  if (NULL == account)
-    return NULL;
-  slen = account - account_url;
-  port = memchr (account_url,
-                 ':',
-                 slen);
-  if ( (0 < slen) &&
-       ('/' == account_url[slen - 1]) )
-    slen--;
-  GNUNET_asprintf (&payto,
-                   ( (NULL == port) && (GNUNET_YES == plaintext) )
-                   ? "payto://x-taler-bank/%.*s:80/%s"
-                   : "payto://x-taler-bank/%.*s/%s",
-                   (int) slen,
-                   account_url,
-                   account + 1);
-  return payto;
-}
-
-
-/**
- * Given an x-taler-bank payto:// URL, compute
- * the HTTP(S) base URL of the account.
- *
- * @param payto the payto URL
- * @return bank URL of the account, NULL if not x-taler-bak payto URL
- */
-char *
-TALER_xtalerbank_base_url_from_payto (const char *payto)
-{
-  const char *start;
-  const char *end;
-  char *ret;
-  int https;
-  const char *colon;
-  unsigned int port;
-
-  if (0 != strncasecmp (payto,
-                        "payto://x-taler-bank/",
-                        strlen ("payto://x-taler-bank/")))
-    return NULL;
-  start = &payto[strlen ("payto://x-taler-bank/")];
-  end = strchr (start,
-                '/');
-  if (NULL == end)
-    end = &start[strlen (start)];
-  colon = strrchr (start,
-                   ':');
-  https = GNUNET_YES;
-  if ( (NULL != colon) &&
-       (1 == sscanf (colon + 1,
-                     "%u",
-                     &port)) &&
-       (443 != port) )
-    https = GNUNET_NO;
-  GNUNET_asprintf (&ret,
-                   "%s://%.*s/",
-                   (https ? "https" : "http"),
-                   (int) (end - start),
-                   start);
-  return ret;
-}
-
-
 /**
  * Obtain the account name from a payto URL.
  *

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



reply via email to

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