diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-03-28 12:29:35 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-03-28 12:29:35 +0100 |
commit | 44b894ebe16f2646b49429bc45208dabb8bbc30b (patch) | |
tree | 5529b660eec8a9ce491673c0f594bb96c9a828dd /src/mintdb/test_mintdb_deposits.c | |
parent | c626ccac51dc968725b2ead1ecb0cebedd9987fc (diff) | |
download | exchange-44b894ebe16f2646b49429bc45208dabb8bbc30b.tar.gz exchange-44b894ebe16f2646b49429bc45208dabb8bbc30b.tar.bz2 exchange-44b894ebe16f2646b49429bc45208dabb8bbc30b.zip |
more rename-fest work
Diffstat (limited to 'src/mintdb/test_mintdb_deposits.c')
-rw-r--r-- | src/mintdb/test_mintdb_deposits.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/mintdb/test_mintdb_deposits.c b/src/mintdb/test_mintdb_deposits.c index dbe12e88d..766bedd70 100644 --- a/src/mintdb/test_mintdb_deposits.c +++ b/src/mintdb/test_mintdb_deposits.c @@ -21,9 +21,11 @@ #include "platform.h" #include <libpq-fe.h> #include <gnunet/gnunet_util_lib.h> -#include "plugin.h" #include "taler_pq_lib.h" -#include "taler-mint-httpd.h" +#include "taler_mintdb_lib.h" +#include "taler_mintdb_plugin.h" + +#define MINT_CURRENCY "EUR" #define DB_URI "postgres:///taler" @@ -51,6 +53,10 @@ static int persistent; */ static int result; +/** + * The plugin. + */ +static struct TALER_MINTDB_Plugin *plugin; /** * Main function that will be run by the scheduler. @@ -77,7 +83,7 @@ run (void *cls, struct TALER_MINTDB_Session *session; deposit = NULL; - EXITIF (GNUNET_OK != TALER_MINT_plugin_load (cfg)); + EXITIF (NULL == (plugin = TALER_MINTDB_plugin_load (cfg))); EXITIF (GNUNET_OK != plugin->create_tables (plugin->cls, ! persistent)); @@ -98,8 +104,8 @@ run (void *cls, htonl (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX)); deposit->amount_with_fee.fraction = htonl (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX)); - GNUNET_assert (strlen (TMH_MINT_CURRENCY) < sizeof (deposit->amount_with_fee.currency)); - strcpy (deposit->amount_with_fee.currency, TMH_MINT_CURRENCY); + GNUNET_assert (strlen (MINT_CURRENCY) < sizeof (deposit->amount_with_fee.currency)); + strcpy (deposit->amount_with_fee.currency, MINT_CURRENCY); /* Copy wireformat */ deposit->wire = json_loads (wire, 0, NULL); EXITIF (GNUNET_OK != @@ -114,7 +120,11 @@ run (void *cls, EXITIF_exit: GNUNET_free_non_null (deposit); - return; + if (NULL != plugin) + { + TALER_MINTDB_plugin_unload (plugin); + plugin = NULL; + } } |