gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated (b8ab8f0 -> a9ff9a0)


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated (b8ab8f0 -> a9ff9a0)
Date: Mon, 23 Apr 2018 17:25:21 +0200

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

marcello pushed a change to branch master
in repository exchange.

    from b8ab8f0  address double-slash situation.
     new eedb4dd  auditor tool to reset db tables.
     new a9ff9a0  reset auditor tables upon running tests, + upgrade "twisted" 
config file.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore                                         |  1 +
 src/auditor/Makefile.am                            | 18 +++++++-
 .../taler-auditor-dbinit.c}                        | 23 ++++++-----
 src/exchange-lib/test_exchange_api_twisted.c       |  2 +-
 src/exchange-lib/test_exchange_api_twisted.conf    | 34 +++++++++++++++
 src/exchange-lib/testing_api_helpers.c             | 48 +++++++++++++++++++++-
 6 files changed, 112 insertions(+), 14 deletions(-)
 copy src/{exchange-tools/taler-exchange-dbinit.c => 
auditor/taler-auditor-dbinit.c} (85%)

diff --git a/.gitignore b/.gitignore
index 7acf2dc..4107ecd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,7 @@ GTAGS
 src/lib/test_exchange_api
 doc/doxygen/doxygen_sqlite3.db
 src/auditor/taler-auditor
+src/auditor/taler-auditor-dbinit
 src/auditor/taler-auditor-sign
 src/bank-lib/test_bank_api
 src/bank-lib/test_bank_api_new
diff --git a/src/auditor/Makefile.am b/src/auditor/Makefile.am
index 0770338..105f91c 100644
--- a/src/auditor/Makefile.am
+++ b/src/auditor/Makefile.am
@@ -14,7 +14,23 @@ pkgcfg_DATA = \
 bin_PROGRAMS = \
   taler-auditor \
   taler-wire-auditor \
-  taler-auditor-sign
+  taler-auditor-sign \
+  taler-auditor-dbinit
+
+taler_auditor_dbinit_SOURCES = \
+  taler-auditor-dbinit.c
+taler_auditor_dbinit_LDADD = \
+  $(LIBGCRYPT_LIBS) \
+  $(top_builddir)/src/util/libtalerutil.la \
+  $(top_builddir)/src/pq/libtalerpq.la \
+  $(top_builddir)/src/auditordb/libtalerauditordb.la \
+  -lgnunetutil  $(XLIB)
+taler_auditor_dbinit_LDFLAGS = \
+  $(POSTGRESQL_LDFLAGS)
+taler_auditor_dbinit_CPPFLAGS = \
+  -I$(top_srcdir)/src/include \
+  -I$(top_srcdir)/src/pq/ \
+  $(POSTGRESQL_CPPFLAGS)
 
 taler_auditor_SOURCES = \
   taler-auditor.c
diff --git a/src/exchange-tools/taler-exchange-dbinit.c 
b/src/auditor/taler-auditor-dbinit.c
similarity index 85%
copy from src/exchange-tools/taler-exchange-dbinit.c
copy to src/auditor/taler-auditor-dbinit.c
index 77aef1e..185a394 100644
--- a/src/exchange-tools/taler-exchange-dbinit.c
+++ b/src/auditor/taler-auditor-dbinit.c
@@ -14,13 +14,14 @@
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
 /**
- * @file exchange-tools/taler-exchange-dbinit.c
- * @brief Create tables for the exchange database.
+ * @file auditor/taler-auditor-dbinit.c
+ * @brief Create tables for the auditor database.
  * @author Florian Dold
+ * @author Marcello Stanisci
  */
 #include "platform.h"
 #include <gnunet/gnunet_util_lib.h>
-#include "taler_exchangedb_plugin.h"
+#include "taler_auditordb_plugin.h"
 
 
 /**
@@ -52,10 +53,10 @@ run (void *cls,
      const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
-  struct TALER_EXCHANGEDB_Plugin *plugin;
+  struct TALER_AUDITORDB_Plugin *plugin;
 
   if (NULL ==
-      (plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
+      (plugin = TALER_AUDITORDB_plugin_load (cfg)))
   {
     fprintf (stderr,
              "Failed to initialize database plugin.\n");
@@ -69,7 +70,7 @@ run (void *cls,
   {
     fprintf (stderr,
              "Failed to initialize database.\n");
-    TALER_EXCHANGEDB_plugin_unload (plugin);
+    TALER_AUDITORDB_plugin_unload (plugin);
     global_ret = 1;
     return;
   }
@@ -79,7 +80,7 @@ run (void *cls,
         fprintf (stderr,
                  "Garbage collection failed!\n");
     }
-  TALER_EXCHANGEDB_plugin_unload (plugin);
+  TALER_AUDITORDB_plugin_unload (plugin);
 }
 
 
@@ -112,13 +113,13 @@ main (int argc,
      away and skip #TALER_OS_init(), which we do need */
   (void) TALER_project_data_default ();
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_log_setup ("taler-exchange-dbinit",
+                 GNUNET_log_setup ("taler-auditor-dbinit",
                                    "INFO",
                                    NULL));
   if (GNUNET_OK !=
       GNUNET_PROGRAM_run (argc, argv,
-                          "taler-exchange-dbinit",
-                         "Initialize Taler exchange database",
+                          "taler-auditor-dbinit",
+                         "Initialize Taler auditor database",
                          options,
                          &run, NULL))
     return 1;
@@ -126,4 +127,4 @@ main (int argc,
 }
 
 
-/* end of taler-exchange-dbinit.c */
+/* end of taler-auditor-dbinit.c */
diff --git a/src/exchange-lib/test_exchange_api_twisted.c 
b/src/exchange-lib/test_exchange_api_twisted.c
index 1e3aa34..8c24928 100644
--- a/src/exchange-lib/test_exchange_api_twisted.c
+++ b/src/exchange-lib/test_exchange_api_twisted.c
@@ -219,4 +219,4 @@ main (int argc,
   return 0;
 }
 
-/* end of test_exchange_api_new.c */
+/* end of test_exchange_api_twisted.c */
diff --git a/src/exchange-lib/test_exchange_api_twisted.conf 
b/src/exchange-lib/test_exchange_api_twisted.conf
index b04d9f4..2b52eb4 100644
--- a/src/exchange-lib/test_exchange_api_twisted.conf
+++ b/src/exchange-lib/test_exchange_api_twisted.conf
@@ -130,6 +130,40 @@ BANK_URL = "http://localhost:8082/";
 # From which account at the 'bank' should outgoing wire transfers be made?
 BANK_ACCOUNT_NUMBER = 2
 
+[account-2]
+URL = payto://x-taler-bank/localhost:8082/2
+PLUGIN = taler_bank
+WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json
+TALER_BANK_AUTH_METHOD = "basic"
+USERNAME = user
+PASSWORD = pass
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[fees-x-taler-bank]
+# Fees for the forseeable future...
+# If you see this after 2017, update to match the next 10 years...
+WIRE-FEE-2018 = EUR:0.01
+WIRE-FEE-2019 = EUR:0.01
+WIRE-FEE-2020 = EUR:0.01
+WIRE-FEE-2021 = EUR:0.01
+WIRE-FEE-2022 = EUR:0.01
+WIRE-FEE-2023 = EUR:0.01
+WIRE-FEE-2024 = EUR:0.01
+WIRE-FEE-2025 = EUR:0.01
+WIRE-FEE-2026 = EUR:0.01
+WIRE-FEE-2027 = EUR:0.01
+
+CLOSING-FEE-2018 = EUR:0.01
+CLOSING-FEE-2019 = EUR:0.01
+CLOSING-FEE-2020 = EUR:0.01
+CLOSING-FEE-2021 = EUR:0.01
+CLOSING-FEE-2022 = EUR:0.01
+CLOSING-FEE-2023 = EUR:0.01
+CLOSING-FEE-2024 = EUR:0.01
+CLOSING-FEE-2025 = EUR:0.01
+CLOSING-FEE-2026 = EUR:0.01
+CLOSING-FEE-2027 = EUR:0.01
 
 [coin_eur_ct_1]
 value = EUR:0.01
diff --git a/src/exchange-lib/testing_api_helpers.c 
b/src/exchange-lib/testing_api_helpers.c
index 8bf66ef..31f28d0 100644
--- a/src/exchange-lib/testing_api_helpers.c
+++ b/src/exchange-lib/testing_api_helpers.c
@@ -185,6 +185,7 @@ TALER_TESTING_prepare_exchange (const char *config_filename,
   GNUNET_OS_process_wait (proc);
   GNUNET_OS_process_destroy (proc);
 
+  /* Reset exchange database.  */
   proc = GNUNET_OS_start_process (GNUNET_NO,
                                   GNUNET_OS_INHERIT_STD_ALL,
                                   NULL, NULL, NULL,
@@ -215,7 +216,7 @@ TALER_TESTING_prepare_exchange (const char *config_filename,
        (0 != code) )
   {
     fprintf (stderr,
-             "Failed to setup database\n");
+             "Failed to setup (exchange) database\n");
     return GNUNET_NO;
   }
   if ( (type != GNUNET_OS_PROCESS_EXITED) ||
@@ -227,6 +228,51 @@ TALER_TESTING_prepare_exchange (const char 
*config_filename,
     return GNUNET_SYSERR;
   }
 
+
+  /* Reset auditor database.  */
+
+  proc = GNUNET_OS_start_process (GNUNET_NO,
+                                  GNUNET_OS_INHERIT_STD_ALL,
+                                  NULL, NULL, NULL,
+                                  "taler-auditor-dbinit",
+                                  "taler-auditor-dbinit",
+                                  "-c", config_filename,
+                                  "-r",
+                                  NULL);
+  if (NULL == proc)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+               "Failed to run `taler-auditor-dbinit`,"
+                " is your PATH correct?\n");
+
+    return GNUNET_NO;
+  }
+  if (GNUNET_SYSERR ==
+      GNUNET_OS_process_wait_status (proc,
+                                     &type,
+                                     &code))
+  {
+    GNUNET_break (0);
+    GNUNET_OS_process_destroy (proc);
+    return GNUNET_SYSERR;
+  }
+  GNUNET_OS_process_destroy (proc);
+  if ( (type == GNUNET_OS_PROCESS_EXITED) &&
+       (0 != code) )
+  {
+    fprintf (stderr,
+             "Failed to setup (auditor) database\n");
+    return GNUNET_NO;
+  }
+  if ( (type != GNUNET_OS_PROCESS_EXITED) ||
+       (0 != code) )
+  {
+    fprintf (stderr,
+             "Unexpected error running"
+             " `taler-auditor-dbinit'!\n");
+    return GNUNET_SYSERR;
+  }
+
   return GNUNET_OK;
 }
 

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



reply via email to

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