gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: remove redundant METHOD option,


From: gnunet
Subject: [taler-exchange] branch master updated: remove redundant METHOD option, we can derive it from PAYTO_URI
Date: Sun, 19 Jan 2020 19:12:53 +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 cb58740f remove redundant METHOD option, we can derive it from 
PAYTO_URI
cb58740f is described below

commit cb58740fbd9805807dba268c65498aaa171f004f
Author: Florian Dold <address@hidden>
AuthorDate: Sun Jan 19 19:12:47 2020 +0100

    remove redundant METHOD option, we can derive it from PAYTO_URI
---
 src/auditor/generate-auditor-basedb.conf                 |  2 --
 src/auditor/test-auditor.conf                            |  1 -
 src/benchmark/benchmark.conf                             |  2 --
 src/exchange/taler-exchange-aggregator.c                 | 14 ++++++++------
 src/exchange/test_taler_exchange_httpd.conf              |  1 -
 src/exchangedb/exchangedb_accounts.c                     | 13 +++++--------
 src/include/taler_bank_service.h                         |  3 +--
 src/testing/test-taler-exchange-aggregator-postgres.conf |  1 -
 src/testing/test-taler-exchange-wirewatch-postgres.conf  |  1 -
 src/testing/test_auditor_api.conf                        |  6 ------
 src/testing/test_bank_api_fakebank.conf                  |  1 -
 src/testing/test_bank_api_pybank_twisted.conf            |  1 -
 src/testing/test_exchange_api.conf                       |  4 ----
 src/testing/test_exchange_api_keys_cherry_picking.conf   |  4 ----
 src/testing/test_exchange_api_twisted.conf               |  3 ---
 15 files changed, 14 insertions(+), 43 deletions(-)

diff --git a/src/auditor/generate-auditor-basedb.conf 
b/src/auditor/generate-auditor-basedb.conf
index 02ed14b7..a2b91f1e 100644
--- a/src/auditor/generate-auditor-basedb.conf
+++ b/src/auditor/generate-auditor-basedb.conf
@@ -80,7 +80,6 @@ CURRENCY = TESTKUDOS
 [exchange-account-1]
 WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
 PAYTO_URI = payto://x-taler-bank/localhost/Exchange
-METHOD = x-taler-bank
 enable_debit = yes
 enable_credit = yes
 WIRE_GATEWAY_URL = "http://localhost:8082/taler-wire-gateway/Exchange/";
@@ -91,7 +90,6 @@ PASSWORD = x
 [merchant-account-merchant]
 PAYTO_URI = payto://x-taler-bank/localhost/42
 WIRE_RESPONSE = ${TALER_CONFIG_HOME}/merchant/account-3.json
-METHOD = x-taler-bank
 HONOR_default = YES
 ACTIVE_default = YES
 
diff --git a/src/auditor/test-auditor.conf b/src/auditor/test-auditor.conf
index a76c9187..4906b55f 100644
--- a/src/auditor/test-auditor.conf
+++ b/src/auditor/test-auditor.conf
@@ -5,7 +5,6 @@ TINY_AMOUNT = TESTKUDOS:0.01
 [exchange-account-1]
 WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
 PAYTO_URI = payto://x-taler-bank/localhost/Exchange
-METHOD = x-taler-bank
 enable_debit = yes
 enable_credit = yes
 WIRE_GATEWAY_URL = "http://localhost:8082/taler-wire-gateway/Exchange/";
diff --git a/src/benchmark/benchmark.conf b/src/benchmark/benchmark.conf
index f59d995c..6bfa7a8a 100644
--- a/src/benchmark/benchmark.conf
+++ b/src/benchmark/benchmark.conf
@@ -51,8 +51,6 @@ WIRE_GATEWAY_URL = http://localhost:8082/2/
 # This is the response we give out for the /wire request.  It provides
 # wallets with the bank information for transfers to the exchange.
 WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json
-# Which wire method should we use to calculate fees?
-METHOD = x-taler-bank
 # Authentication information for basic authentication
 WIRE_GATEWAY_AUTH_METHOD = "basic"
 username = user
diff --git a/src/exchange/taler-exchange-aggregator.c 
b/src/exchange/taler-exchange-aggregator.c
index 97809e06..e9474d89 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -431,8 +431,7 @@ find_account_by_url (const char *url)
 
 /**
  * Function called with information about a wire account.  Adds
- * the account to our list (if it is enabled and we can load the
- * plugin).
+ * the account to our list.
  *
  * @param cls closure, NULL
  * @param ai account information
@@ -442,6 +441,7 @@ add_account_cb (void *cls,
                 const struct TALER_EXCHANGEDB_AccountInfo *ai)
 {
   struct WireAccount *wa;
+  char *payto_uri;
 
   (void) cls;
   if (GNUNET_YES != ai->debit_enabled)
@@ -450,22 +450,24 @@ add_account_cb (void *cls,
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg,
                                              ai->section_name,
-                                             "METHOD",
-                                             &wa->method))
+                                             "PAYTO_URI",
+                                             &payto_uri))
   {
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                ai->section_name,
-                               "METHOD");
+                               "PAYTO_URI");
     GNUNET_free (wa);
     return;
   }
+  wa->method = TALER_payto_get_method (payto_uri);
+  GNUNET_free (payto_uri);
   if (GNUNET_OK !=
       TALER_BANK_auth_parse_cfg (cfg,
                                  ai->section_name,
                                  &wa->auth))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
-                "Failed to load account `%s'\n",
+                "Failed to load exchange account `%s'\n",
                 ai->section_name);
     GNUNET_free (wa->method);
     GNUNET_free (wa);
diff --git a/src/exchange/test_taler_exchange_httpd.conf 
b/src/exchange/test_taler_exchange_httpd.conf
index 7a233f12..8c2f944c 100644
--- a/src/exchange/test_taler_exchange_httpd.conf
+++ b/src/exchange/test_taler_exchange_httpd.conf
@@ -49,7 +49,6 @@ CONFIG = "postgres:///talercheck"
 [exchange-account-1]
 PAYTO_URI = "payto://x-taler-bank/localhost:8082/3"
 WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
-METHOD = "x-taler-bank"
 ENABLE_DEBIT = YES
 ENABLE_CREDIT = YES
 TALER_BANK_AUTH_METHOD = NONE
diff --git a/src/exchangedb/exchangedb_accounts.c 
b/src/exchangedb/exchangedb_accounts.c
index fd8ed538..532e27f6 100644
--- a/src/exchangedb/exchangedb_accounts.c
+++ b/src/exchangedb/exchangedb_accounts.c
@@ -78,15 +78,12 @@ check_for_account (void *cls,
                                "PAYTO_URI");
     return;
   }
-  if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_string (ctx->cfg,
-                                             section,
-                                             "METHOD",
-                                             &method))
+  method = TALER_payto_get_method (payto_uri);
+  if (NULL == method)
   {
-    GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
-                               section,
-                               "METHOD");
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "payto URI in config ([%s]/PAYTO_URI) malformed\n",
+                section);
     GNUNET_free (payto_uri);
     return;
   }
diff --git a/src/include/taler_bank_service.h b/src/include/taler_bank_service.h
index 4b2aca66..98a1017c 100644
--- a/src/include/taler_bank_service.h
+++ b/src/include/taler_bank_service.h
@@ -462,8 +462,7 @@ TALER_BANK_debit_history_cancel (struct 
TALER_BANK_DebitHistoryHandle *hh);
 
 /**
  * Convenience method for parsing configuration section with bank
- * authentication data.  The section must contain an option
- * "METHOD", plus other options that depend on the METHOD specified.
+ * authentication data.
  *
  * @param cfg configuration to parse
  * @param section the section with the configuration data
diff --git a/src/testing/test-taler-exchange-aggregator-postgres.conf 
b/src/testing/test-taler-exchange-aggregator-postgres.conf
index 6f5f9d83..0f8ed70d 100644
--- a/src/testing/test-taler-exchange-aggregator-postgres.conf
+++ b/src/testing/test-taler-exchange-aggregator-postgres.conf
@@ -62,7 +62,6 @@ WIRE_GATEWAY_URL = "http://localhost:8082/2/";
 WIRE_GATEWAY_AUTH_METHOD = basic
 USERNAME = Exchange
 PASSWORD = x
-method = "x-taler-bank"
 WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
 ENABLE_DEBIT = YES
 ENABLE_CREDIT = YES
diff --git a/src/testing/test-taler-exchange-wirewatch-postgres.conf 
b/src/testing/test-taler-exchange-wirewatch-postgres.conf
index 19db0e0b..168e7eda 100644
--- a/src/testing/test-taler-exchange-wirewatch-postgres.conf
+++ b/src/testing/test-taler-exchange-wirewatch-postgres.conf
@@ -53,7 +53,6 @@ WIRE_GATEWAY_AUTH_METHOD = basic
 USERNAME = Exchange
 PASSWORD = x
 
-METHOD = x-taler-bank
 WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
 PLUGIN = "taler_bank"
 ENABLE_DEBIT = YES
diff --git a/src/testing/test_auditor_api.conf 
b/src/testing/test_auditor_api.conf
index 9a480490..da84149b 100644
--- a/src/testing/test_auditor_api.conf
+++ b/src/testing/test_auditor_api.conf
@@ -65,9 +65,6 @@ WIRE_GATEWAY_URL = "http://localhost:8082/42/";
 # wallets with the bank information for transfers to the exchange.
 WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
 
-# Which wire plugin should we used to access the account?
-METHOD = x-taler-bank
-
 [bank]
 HTTP_PORT = 8082
 
@@ -82,9 +79,6 @@ PAYTO_URI = "payto://x-taler-bank/localhost/2"
 # wallets with the bank information for transfers to the exchange.
 WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json
 
-# Which wire plugin should we used to access the account?
-METHOD = x-taler-bank
-
 # Authentication information for basic authentication
 WIRE_GATEWAY_AUTH_METHOD = "basic"
 USERNAME = user
diff --git a/src/testing/test_bank_api_fakebank.conf 
b/src/testing/test_bank_api_fakebank.conf
index 3d448ec5..5d505359 100644
--- a/src/testing/test_bank_api_fakebank.conf
+++ b/src/testing/test_bank_api_fakebank.conf
@@ -5,7 +5,6 @@ currency = KUDOS
 
 [exchange-account-2]
 PAYTO_URI = payto://x-taler-bank/localhost/2
-METHOD = x-taler-bank
 WIRE_GATEWAY_URL = "http://localhost:8081/2/";
 WIRE_GATEWAY_AUTH_METHOD = basic
 USERNAME = Exchange
diff --git a/src/testing/test_bank_api_pybank_twisted.conf 
b/src/testing/test_bank_api_pybank_twisted.conf
index 3801590b..9fe0fa1c 100644
--- a/src/testing/test_bank_api_pybank_twisted.conf
+++ b/src/testing/test_bank_api_pybank_twisted.conf
@@ -35,7 +35,6 @@ PAYTO_URI = payto://x-taler-bank/localhost/1
 
 [exchange-account-2]
 PAYTO_URI = payto://x-taler-bank/localhost/Exchange
-METHOD = x-taler-bank
 WIRE_GATEWAY_URL = "http://localhost:8888/taler-wire-gateway/Exchange/";
 WIRE_GATEWAY_AUTH_METHOD = basic
 USERNAME = Exchange
diff --git a/src/testing/test_exchange_api.conf 
b/src/testing/test_exchange_api.conf
index ed74d89e..6af202e3 100644
--- a/src/testing/test_exchange_api.conf
+++ b/src/testing/test_exchange_api.conf
@@ -64,8 +64,6 @@ PAYTO_URI = "payto://x-taler-bank/localhost/42"
 # This is the response we give out for the /wire request.  It provides
 # wallets with the bank information for transfers to the exchange.
 WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
-# Which wire plugin should we used to access the account?
-METHOD = x-taler-bank
 
 WIRE_GATEWAY_URL = "http://localhost:9081/42/";
 
@@ -84,8 +82,6 @@ WIRE_GATEWAY_AUTH_METHOD = basic
 USERNAME = Exchange
 PASSWORD = x
 
-METHOD = x-taler-bank
-
 WIRE_GATEWAY_URL = "http://localhost:9081/2/";
 
 ENABLE_DEBIT = YES
diff --git a/src/testing/test_exchange_api_keys_cherry_picking.conf 
b/src/testing/test_exchange_api_keys_cherry_picking.conf
index 6823e81d..0416c8ee 100644
--- a/src/testing/test_exchange_api_keys_cherry_picking.conf
+++ b/src/testing/test_exchange_api_keys_cherry_picking.conf
@@ -73,8 +73,6 @@ WIRE_RESPONSE = ${TALER_CONFIG_HOME}/iban.json
 # What is the URL of our bank account? Must match WIRE_RESPONSE above!
 PAYTO_URI = payto://x-taler-bank/localhost/42
 
-METHOD = "x-taler-bank"
-
 WIRE_GATEWAY_URL = "http://localhost:9082/42/";
 
 
@@ -88,8 +86,6 @@ PAYTO_URI = payto://x-taler-bank/localhost/2
 
 WIRE_GATEWAY_URL = "http://localhost:9082/2/";
 
-METHOD = "x-taler-bank"
-
 # Authentication information for basic authentication
 TALER_BANK_AUTH_METHOD = "basic"
 USERNAME = user
diff --git a/src/testing/test_exchange_api_twisted.conf 
b/src/testing/test_exchange_api_twisted.conf
index 5158aefe..2cda46e5 100644
--- a/src/testing/test_exchange_api_twisted.conf
+++ b/src/testing/test_exchange_api_twisted.conf
@@ -62,8 +62,6 @@ PAYTO_URI = "payto://x-taler-bank/localhost/42"
 # This is the response we give out for the /wire request.  It provides
 # wallets with the bank information for transfers to the exchange.
 WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
-# Which wire plugin should we used to access the account?
-METHOD = x-taler-bank
 WIRE_GATEWAY_URL = "http://localhost:9081/42/";
 WIRE_GATEWAY_AUTH_METHOD = NONE
 
@@ -77,7 +75,6 @@ USERNAME = user
 PASSWORD = pass
 ENABLE_DEBIT = YES
 ENABLE_CREDIT = YES
-METHOD = x-taler-bank
 
 
 [bank]

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



reply via email to

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