summaryrefslogtreecommitdiff
path: root/src/auditordb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-06-15 22:10:12 +0200
committerChristian Grothoff <christian@grothoff.org>2017-06-15 22:10:12 +0200
commit0e6c4ba898b0f4c7e53b02a65f99cc4b6b066ad7 (patch)
treed4f74fb23e802cc6e699892aece5fcc5631df88d /src/auditordb
parenteb354680b45f167ded8b9a6a01090f34d88775f3 (diff)
downloadexchange-0e6c4ba898b0f4c7e53b02a65f99cc4b6b066ad7.tar.gz
exchange-0e6c4ba898b0f4c7e53b02a65f99cc4b6b066ad7.tar.bz2
exchange-0e6c4ba898b0f4c7e53b02a65f99cc4b6b066ad7.zip
work on #5010
Diffstat (limited to 'src/auditordb')
-rw-r--r--src/auditordb/plugin_auditordb_postgres.c25
-rw-r--r--src/auditordb/test_auditordb.c3
2 files changed, 8 insertions, 20 deletions
diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c
index f144746ac..57f9e89c9 100644
--- a/src/auditordb/plugin_auditordb_postgres.c
+++ b/src/auditordb/plugin_auditordb_postgres.c
@@ -1159,16 +1159,13 @@ postgres_gc (void *cls)
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param issue issuing information with value, fees and other info about the denomination
- * @return #GNUNET_OK on success; #GNUNET_SYSERR on failure
+ * @return operation status result
*/
-static int
+static enum GNUNET_DB_QueryStatus
postgres_insert_denomination_info (void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_DenominationKeyValidityPS *issue)
{
- PGresult *result;
- int ret;
-
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (&issue->denom_hash),
GNUNET_PQ_query_param_auto_from_type (&issue->master),
@@ -1198,20 +1195,9 @@ postgres_insert_denomination_info (void *cls,
TALER_amount_cmp_currency_nbo (&issue->value,
&issue->fee_refund));
- result = GNUNET_PQ_exec_prepared (session->conn,
- "auditor_denominations_insert",
- params);
- if (PGRES_COMMAND_OK != PQresultStatus (result))
- {
- ret = GNUNET_SYSERR;
- BREAK_DB_ERR (result);
- }
- else
- {
- ret = GNUNET_OK;
- }
- PQclear (result);
- return ret;
+ return GNUNET_PQ_eval_prepared_non_select (session->conn,
+ "auditor_denominations_insert",
+ params);
}
@@ -1237,6 +1223,7 @@ postgres_select_denomination_info (void *cls,
GNUNET_PQ_query_param_end
};
PGresult *result;
+
result = GNUNET_PQ_exec_prepared (session->conn,
"auditor_denominations_select",
params);
diff --git a/src/auditordb/test_auditordb.c b/src/auditordb/test_auditordb.c
index bc23f1160..858e6bd91 100644
--- a/src/auditordb/test_auditordb.c
+++ b/src/auditordb/test_auditordb.c
@@ -19,6 +19,7 @@
* @author Gabor X Toth
*/
#include "platform.h"
+#include <gnunet/gnunet_db_lib.h>
#include "taler_auditordb_lib.h"
#include "taler_auditordb_plugin.h"
@@ -193,7 +194,7 @@ run (void *cls)
TALER_amount_hton (&issue.fee_refresh, &fee_refresh);
TALER_amount_hton (&issue.fee_refund, &fee_refund);
- FAILIF (GNUNET_OK !=
+ FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_denomination_info (plugin->cls,
session,
&issue));