summaryrefslogtreecommitdiff
path: root/src/auditordb
diff options
context:
space:
mode:
Diffstat (limited to 'src/auditordb')
-rw-r--r--src/auditordb/auditor-0001.sql11
-rw-r--r--src/auditordb/auditordb_plugin.c11
-rw-r--r--src/auditordb/plugin_auditordb_postgres.c142
-rw-r--r--src/auditordb/test_auditordb.c61
4 files changed, 163 insertions, 62 deletions
diff --git a/src/auditordb/auditor-0001.sql b/src/auditordb/auditor-0001.sql
index 0faa890d..daefdc17 100644
--- a/src/auditordb/auditor-0001.sql
+++ b/src/auditordb/auditor-0001.sql
@@ -47,6 +47,11 @@ CREATE TABLE IF NOT EXISTS auditor_progress_reserve
,last_reserve_out_serial_id INT8 NOT NULL DEFAULT 0
,last_reserve_recoup_serial_id INT8 NOT NULL DEFAULT 0
,last_reserve_close_serial_id INT8 NOT NULL DEFAULT 0
+ ,last_purse_merges_serial_id INT8 NOT NULL DEFAULT 0
+ ,last_purse_deposits_serial_id INT8 NOT NULL DEFAULT 0
+ ,last_account_merges_serial_id INT8 NOT NULL DEFAULT 0
+ ,last_history_requests_serial_id INT8 NOT NULL DEFAULT 0
+ ,last_close_requests_serial_id INT8 NOT NULL DEFAULT 0
,PRIMARY KEY (master_pub)
);
COMMENT ON TABLE auditor_progress_reserve
@@ -82,6 +87,8 @@ CREATE TABLE IF NOT EXISTS auditor_progress_coin
,last_refund_serial_id INT8 NOT NULL DEFAULT 0
,last_recoup_serial_id INT8 NOT NULL DEFAULT 0
,last_recoup_refresh_serial_id INT8 NOT NULL DEFAULT 0
+ ,last_purse_deposits_serial_id INT8 NOT NULL DEFAULT 0
+ ,last_purse_refunds_serial_id INT8 NOT NULL DEFAULT 0
,PRIMARY KEY (master_pub)
);
COMMENT ON TABLE auditor_progress_coin
@@ -136,6 +143,10 @@ CREATE TABLE IF NOT EXISTS auditor_reserve_balance
,reserve_balance_frac INT4 NOT NULL
,withdraw_fee_balance_val INT8 NOT NULL
,withdraw_fee_balance_frac INT4 NOT NULL
+ ,purse_fee_balance_val INT8 NOT NULL
+ ,purse_fee_balance_frac INT4 NOT NULL
+ ,history_fee_balance_val INT8 NOT NULL
+ ,history_fee_balance_frac INT4 NOT NULL
);
COMMENT ON TABLE auditor_reserve_balance
IS 'sum of the balances of all customer reserves (by exchange master public key)';
diff --git a/src/auditordb/auditordb_plugin.c b/src/auditordb/auditordb_plugin.c
index d04e8815..635247aa 100644
--- a/src/auditordb/auditordb_plugin.c
+++ b/src/auditordb/auditordb_plugin.c
@@ -24,12 +24,6 @@
#include <ltdl.h>
-/**
- * Initialize the plugin.
- *
- * @param cfg configuration to use
- * @return #GNUNET_OK on success
- */
struct TALER_AUDITORDB_Plugin *
TALER_AUDITORDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg)
{
@@ -62,11 +56,6 @@ TALER_AUDITORDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg)
}
-/**
- * Shutdown the plugin.
- *
- * @param plugin the plugin to unload
- */
void
TALER_AUDITORDB_plugin_unload (struct TALER_AUDITORDB_Plugin *plugin)
{
diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c
index 7931900a..97189320 100644
--- a/src/auditordb/plugin_auditordb_postgres.c
+++ b/src/auditordb/plugin_auditordb_postgres.c
@@ -144,7 +144,7 @@ postgres_create_tables (void *cls)
* @param[in,out] pg the plugin-specific state
* @return #GNUNET_OK on success
*/
-static int
+static enum GNUNET_GenericReturnValue
setup_connection (struct PostgresClosure *pg)
{
struct GNUNET_PQ_PreparedStatement ps[] = {
@@ -230,8 +230,13 @@ setup_connection (struct PostgresClosure *pg)
",last_reserve_out_serial_id=$2"
",last_reserve_recoup_serial_id=$3"
",last_reserve_close_serial_id=$4"
- " WHERE master_pub=$5",
- 5),
+ ",last_purse_merges_serial_id=$5"
+ ",last_purse_deposits_serial_id=$6"
+ ",last_account_merges_serial_id=$7"
+ ",last_history_requests_serial_id=$8"
+ ",last_close_requests_serial_id=$9"
+ " WHERE master_pub=$10",
+ 10),
/* Used in #postgres_get_auditor_progress_reserve() */
GNUNET_PQ_make_prepare ("auditor_progress_select_reserve",
"SELECT"
@@ -239,6 +244,11 @@ setup_connection (struct PostgresClosure *pg)
",last_reserve_out_serial_id"
",last_reserve_recoup_serial_id"
",last_reserve_close_serial_id"
+ ",last_purse_merges_serial_id"
+ ",last_purse_deposits_serial_id"
+ ",last_account_merges_serial_id"
+ ",last_history_requests_serial_id"
+ ",last_close_requests_serial_id"
" FROM auditor_progress_reserve"
" WHERE master_pub=$1;",
1),
@@ -250,8 +260,13 @@ setup_connection (struct PostgresClosure *pg)
",last_reserve_out_serial_id"
",last_reserve_recoup_serial_id"
",last_reserve_close_serial_id"
- ") VALUES ($1,$2,$3,$4,$5);",
- 5),
+ ",last_purse_merges_serial_id"
+ ",last_purse_deposits_serial_id"
+ ",last_account_merges_serial_id"
+ ",last_history_requests_serial_id"
+ ",last_close_requests_serial_id"
+ ") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10);",
+ 10),
/* Used in #postgres_update_auditor_progress_aggregation() */
GNUNET_PQ_make_prepare ("auditor_progress_update_aggregation",
"UPDATE auditor_progress_aggregation SET "
@@ -301,8 +316,10 @@ setup_connection (struct PostgresClosure *pg)
",last_refund_serial_id=$4"
",last_recoup_serial_id=$5"
",last_recoup_refresh_serial_id=$6"
- " WHERE master_pub=$7",
- 7),
+ ",last_purse_deposits_serial_id=$7"
+ ",last_purse_refunds_serial_id=$8"
+ " WHERE master_pub=$9",
+ 9),
/* Used in #postgres_get_auditor_progress_coin() */
GNUNET_PQ_make_prepare ("auditor_progress_select_coin",
"SELECT"
@@ -312,6 +329,8 @@ setup_connection (struct PostgresClosure *pg)
",last_refund_serial_id"
",last_recoup_serial_id"
",last_recoup_refresh_serial_id"
+ ",last_purse_deposits_serial_id"
+ ",last_purse_refunds_serial_id"
" FROM auditor_progress_coin"
" WHERE master_pub=$1;",
1),
@@ -325,8 +344,10 @@ setup_connection (struct PostgresClosure *pg)
",last_refund_serial_id"
",last_recoup_serial_id"
",last_recoup_refresh_serial_id"
- ") VALUES ($1,$2,$3,$4,$5,$6,$7);",
- 7),
+ ",last_purse_deposits_serial_id"
+ ",last_purse_refunds_serial_id"
+ ") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9);",
+ 9),
/* Used in #postgres_insert_wire_auditor_account_progress() */
GNUNET_PQ_make_prepare ("wire_auditor_account_progress_insert",
"INSERT INTO wire_auditor_account_progress "
@@ -430,8 +451,12 @@ setup_connection (struct PostgresClosure *pg)
",reserve_balance_frac"
",withdraw_fee_balance_val"
",withdraw_fee_balance_frac"
- ") VALUES ($1,$2,$3,$4,$5)",
- 5),
+ ",purse_fee_balance_val"
+ ",purse_fee_balance_frac"
+ ",history_fee_balance_val"
+ ",history_fee_balance_frac"
+ ") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9)",
+ 9),
/* Used in #postgres_update_reserve_summary() */
GNUNET_PQ_make_prepare ("auditor_reserve_balance_update",
"UPDATE auditor_reserve_balance SET"
@@ -439,8 +464,12 @@ setup_connection (struct PostgresClosure *pg)
",reserve_balance_frac=$2"
",withdraw_fee_balance_val=$3"
",withdraw_fee_balance_frac=$4"
- " WHERE master_pub=$5;",
- 5),
+ ",purse_fee_balance_val=$5"
+ ",purse_fee_balance_frac=$6"
+ ",history_fee_balance_val=$7"
+ ",history_fee_balance_frac=$8"
+ " WHERE master_pub=$9;",
+ 9),
/* Used in #postgres_get_reserve_summary() */
GNUNET_PQ_make_prepare ("auditor_reserve_balance_select",
"SELECT"
@@ -448,6 +477,10 @@ setup_connection (struct PostgresClosure *pg)
",reserve_balance_frac"
",withdraw_fee_balance_val"
",withdraw_fee_balance_frac"
+ ",purse_fee_balance_val"
+ ",purse_fee_balance_frac"
+ ",history_fee_balance_val"
+ ",history_fee_balance_frac"
" FROM auditor_reserve_balance"
" WHERE master_pub=$1;",
1),
@@ -796,7 +829,7 @@ static enum GNUNET_GenericReturnValue
postgres_gc (void *cls)
{
struct PostgresClosure *pg = cls;
- struct GNUNET_TIME_Absolute now;
+ struct GNUNET_TIME_Absolute now = {0};
struct GNUNET_PQ_QueryParam params_time[] = {
GNUNET_PQ_query_param_absolute_time (&now),
GNUNET_PQ_query_param_end
@@ -1225,6 +1258,11 @@ postgres_insert_auditor_progress_reserve (
GNUNET_PQ_query_param_uint64 (&ppr->last_reserve_out_serial_id),
GNUNET_PQ_query_param_uint64 (&ppr->last_reserve_recoup_serial_id),
GNUNET_PQ_query_param_uint64 (&ppr->last_reserve_close_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppr->last_purse_merges_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppr->last_purse_deposits_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppr->last_account_merges_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppr->last_history_requests_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppr->last_close_requests_serial_id),
GNUNET_PQ_query_param_end
};
@@ -1255,6 +1293,11 @@ postgres_update_auditor_progress_reserve (
GNUNET_PQ_query_param_uint64 (&ppr->last_reserve_out_serial_id),
GNUNET_PQ_query_param_uint64 (&ppr->last_reserve_recoup_serial_id),
GNUNET_PQ_query_param_uint64 (&ppr->last_reserve_close_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppr->last_purse_merges_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppr->last_purse_deposits_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppr->last_account_merges_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppr->last_history_requests_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppr->last_close_requests_serial_id),
GNUNET_PQ_query_param_auto_from_type (master_pub),
GNUNET_PQ_query_param_end
};
@@ -1293,6 +1336,16 @@ postgres_get_auditor_progress_reserve (
&ppr->last_reserve_recoup_serial_id),
GNUNET_PQ_result_spec_uint64 ("last_reserve_close_serial_id",
&ppr->last_reserve_close_serial_id),
+ GNUNET_PQ_result_spec_uint64 ("last_purse_merges_serial_id",
+ &ppr->last_purse_merges_serial_id),
+ GNUNET_PQ_result_spec_uint64 ("last_purse_deposits_serial_id",
+ &ppr->last_purse_deposits_serial_id),
+ GNUNET_PQ_result_spec_uint64 ("last_account_merges_serial_id",
+ &ppr->last_account_merges_serial_id),
+ GNUNET_PQ_result_spec_uint64 ("last_history_requests_serial_id",
+ &ppr->last_history_requests_serial_id),
+ GNUNET_PQ_result_spec_uint64 ("last_close_requests_serial_id",
+ &ppr->last_close_requests_serial_id),
GNUNET_PQ_result_spec_end
};
@@ -1503,6 +1556,8 @@ postgres_insert_auditor_progress_coin (
GNUNET_PQ_query_param_uint64 (&ppc->last_refund_serial_id),
GNUNET_PQ_query_param_uint64 (&ppc->last_recoup_serial_id),
GNUNET_PQ_query_param_uint64 (&ppc->last_recoup_refresh_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppc->last_purse_deposits_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppc->last_purse_refunds_serial_id),
GNUNET_PQ_query_param_end
};
@@ -1535,6 +1590,8 @@ postgres_update_auditor_progress_coin (
GNUNET_PQ_query_param_uint64 (&ppc->last_refund_serial_id),
GNUNET_PQ_query_param_uint64 (&ppc->last_recoup_serial_id),
GNUNET_PQ_query_param_uint64 (&ppc->last_recoup_refresh_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppc->last_purse_deposits_serial_id),
+ GNUNET_PQ_query_param_uint64 (&ppc->last_purse_refunds_serial_id),
GNUNET_PQ_query_param_auto_from_type (master_pub),
GNUNET_PQ_query_param_end
};
@@ -1577,6 +1634,10 @@ postgres_get_auditor_progress_coin (
&ppc->last_recoup_serial_id),
GNUNET_PQ_result_spec_uint64 ("last_recoup_refresh_serial_id",
&ppc->last_recoup_refresh_serial_id),
+ GNUNET_PQ_result_spec_uint64 ("last_purse_deposits_serial_id",
+ &ppc->last_purse_deposits_serial_id),
+ GNUNET_PQ_result_spec_uint64 ("last_purse_refunds_serial_id",
+ &ppc->last_purse_refunds_serial_id),
GNUNET_PQ_result_spec_end
};
@@ -1965,7 +2026,8 @@ postgres_get_reserve_info (void *cls,
* @param master_pub master public key of the exchange
* @param reserve_balance amount stored in the reserve
* @param withdraw_fee_balance amount the exchange gained in withdraw fees
- * due to withdrawals from this reserve
+ * @param purse_fee_balance amount the exchange gained in purse fees
+ * @param history_fee_balance amount the exchange gained in history fees
* @return transaction status code
*/
static enum GNUNET_DB_QueryStatus
@@ -1973,13 +2035,17 @@ postgres_insert_reserve_summary (
void *cls,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *reserve_balance,
- const struct TALER_Amount *withdraw_fee_balance)
+ const struct TALER_Amount *withdraw_fee_balance,
+ const struct TALER_Amount *purse_fee_balance,
+ const struct TALER_Amount *history_fee_balance)
{
struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub),
TALER_PQ_query_param_amount (reserve_balance),
TALER_PQ_query_param_amount (withdraw_fee_balance),
+ TALER_PQ_query_param_amount (purse_fee_balance),
+ TALER_PQ_query_param_amount (history_fee_balance),
GNUNET_PQ_query_param_end
};
@@ -2002,6 +2068,8 @@ postgres_insert_reserve_summary (
* @param reserve_balance amount stored in the reserve
* @param withdraw_fee_balance amount the exchange gained in withdraw fees
* due to withdrawals from this reserve
+ * @param purse_fee_balance amount the exchange gained in purse fees
+ * @param history_fee_balance amount the exchange gained in history fees
* @return transaction status code
*/
static enum GNUNET_DB_QueryStatus
@@ -2009,12 +2077,16 @@ postgres_update_reserve_summary (
void *cls,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *reserve_balance,
- const struct TALER_Amount *withdraw_fee_balance)
+ const struct TALER_Amount *withdraw_fee_balance,
+ const struct TALER_Amount *purse_fee_balance,
+ const struct TALER_Amount *history_fee_balance)
{
struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = {
TALER_PQ_query_param_amount (reserve_balance),
TALER_PQ_query_param_amount (withdraw_fee_balance),
+ TALER_PQ_query_param_amount (purse_fee_balance),
+ TALER_PQ_query_param_amount (history_fee_balance),
GNUNET_PQ_query_param_auto_from_type (master_pub),
GNUNET_PQ_query_param_end
};
@@ -2030,16 +2102,19 @@ postgres_update_reserve_summary (
*
* @param cls the @e cls of this struct with the plugin-specific state
* @param master_pub master public key of the exchange
- * @param[out] reserve_balance amount stored in the reserve
+ * @param[out] reserve_balance amount stored in reserves
* @param[out] withdraw_fee_balance amount the exchange gained in withdraw fees
- * due to withdrawals from this reserve
+ * @param[out] purse_fee_balance amount the exchange gained in purse fees
+ * @param[out] history_fee_balance amount the exchange gained in history fees
* @return transaction status code
*/
static enum GNUNET_DB_QueryStatus
postgres_get_reserve_summary (void *cls,
const struct TALER_MasterPublicKeyP *master_pub,
struct TALER_Amount *reserve_balance,
- struct TALER_Amount *withdraw_fee_balance)
+ struct TALER_Amount *withdraw_fee_balance,
+ struct TALER_Amount *purse_fee_balance,
+ struct TALER_Amount *history_fee_balance)
{
struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = {
@@ -2049,7 +2124,8 @@ postgres_get_reserve_summary (void *cls,
struct GNUNET_PQ_ResultSpec rs[] = {
TALER_PQ_RESULT_SPEC_AMOUNT ("reserve_balance", reserve_balance),
TALER_PQ_RESULT_SPEC_AMOUNT ("withdraw_fee_balance", withdraw_fee_balance),
-
+ TALER_PQ_RESULT_SPEC_AMOUNT ("purse_fee_balance", purse_fee_balance),
+ TALER_PQ_RESULT_SPEC_AMOUNT ("history_fee_balance", history_fee_balance),
GNUNET_PQ_result_spec_end
};
@@ -2163,7 +2239,7 @@ postgres_get_wire_fee_summary (void *cls,
static enum GNUNET_DB_QueryStatus
postgres_insert_denomination_balance (
void *cls,
- const struct TALER_DenominationHash *denom_pub_hash,
+ const struct TALER_DenominationHashP *denom_pub_hash,
const struct TALER_Amount *denom_balance,
const struct TALER_Amount *denom_loss,
const struct TALER_Amount *denom_risk,
@@ -2203,7 +2279,7 @@ postgres_insert_denomination_balance (
static enum GNUNET_DB_QueryStatus
postgres_update_denomination_balance (
void *cls,
- const struct TALER_DenominationHash *denom_pub_hash,
+ const struct TALER_DenominationHashP *denom_pub_hash,
const struct TALER_Amount *denom_balance,
const struct TALER_Amount *denom_loss,
const struct TALER_Amount *denom_risk,
@@ -2240,14 +2316,14 @@ postgres_update_denomination_balance (
* @return transaction status code
*/
static enum GNUNET_DB_QueryStatus
-postgres_get_denomination_balance (void *cls,
- const struct
- TALER_DenominationHash *denom_pub_hash,
- struct TALER_Amount *denom_balance,
- struct TALER_Amount *denom_loss,
- struct TALER_Amount *denom_risk,
- struct TALER_Amount *recoup_loss,
- uint64_t *num_issued)
+postgres_get_denomination_balance (
+ void *cls,
+ const struct TALER_DenominationHashP *denom_pub_hash,
+ struct TALER_Amount *denom_balance,
+ struct TALER_Amount *denom_loss,
+ struct TALER_Amount *denom_risk,
+ struct TALER_Amount *recoup_loss,
+ uint64_t *num_issued)
{
struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = {
@@ -2439,7 +2515,7 @@ static enum GNUNET_DB_QueryStatus
postgres_insert_historic_denom_revenue (
void *cls,
const struct TALER_MasterPublicKeyP *master_pub,
- const struct TALER_DenominationHash *denom_pub_hash,
+ const struct TALER_DenominationHashP *denom_pub_hash,
struct GNUNET_TIME_Timestamp revenue_timestamp,
const struct TALER_Amount *revenue_balance,
const struct TALER_Amount *loss_balance)
@@ -2506,7 +2582,7 @@ historic_denom_revenue_cb (void *cls,
for (unsigned int i = 0; i < num_results; i++)
{
- struct TALER_DenominationHash denom_pub_hash;
+ struct TALER_DenominationHashP denom_pub_hash;
struct GNUNET_TIME_Timestamp revenue_timestamp;
struct TALER_Amount revenue_balance;
struct TALER_Amount loss;
diff --git a/src/auditordb/test_auditordb.c b/src/auditordb/test_auditordb.c
index f8faa069..f2fad2bc 100644
--- a/src/auditordb/test_auditordb.c
+++ b/src/auditordb/test_auditordb.c
@@ -130,10 +130,10 @@ run (void *cls)
struct TALER_MasterPublicKeyP master_pub;
struct TALER_ReservePublicKeyP reserve_pub;
- struct TALER_DenominationHash rnd_hash;
+ struct TALER_DenominationHashP rnd_hash;
struct TALER_DenominationPrivateKey denom_priv;
struct TALER_DenominationPublicKey denom_pub;
- struct TALER_DenominationHash denom_pub_hash;
+ struct TALER_DenominationHashP denom_pub_hash;
struct GNUNET_TIME_Timestamp now;
struct GNUNET_TIME_Timestamp past;
struct GNUNET_TIME_Timestamp future;
@@ -220,8 +220,14 @@ run (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Test: insert_reserve_info\n");
- struct TALER_Amount reserve_balance, withdraw_fee_balance;
- struct TALER_Amount reserve_balance2 = {}, withdraw_fee_balance2 = {};
+ struct TALER_Amount reserve_balance;
+ struct TALER_Amount withdraw_fee_balance;
+ struct TALER_Amount purse_fee_balance;
+ struct TALER_Amount history_fee_balance;
+ struct TALER_Amount reserve_balance2 = {};
+ struct TALER_Amount withdraw_fee_balance2 = {};
+ struct TALER_Amount purse_fee_balance2 = {};
+ struct TALER_Amount history_fee_balance2 = {};
GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (CURRENCY ":12.345678",
@@ -229,6 +235,12 @@ run (void *cls)
GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (CURRENCY ":23.456789",
&withdraw_fee_balance));
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount (CURRENCY ":23.456789",
+ &purse_fee_balance));
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount (CURRENCY ":23.456789",
+ &history_fee_balance));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
@@ -268,10 +280,12 @@ run (void *cls)
FAILIF (0 != strcmp (payto,
"payto://bla/blub"));
GNUNET_free (payto);
- FAILIF (0 != GNUNET_memcmp (&date, &future)
- || 0 != GNUNET_memcmp (&reserve_balance2, &reserve_balance)
- || 0 != GNUNET_memcmp (&withdraw_fee_balance2,
- &withdraw_fee_balance));
+ FAILIF (0 != GNUNET_memcmp (&date,
+ &future)
+ || 0 != TALER_amount_cmp (&reserve_balance2,
+ &reserve_balance)
+ || 0 != TALER_amount_cmp (&withdraw_fee_balance2,
+ &withdraw_fee_balance));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Test: insert_reserve_summary\n");
@@ -279,8 +293,10 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_reserve_summary (plugin->cls,
&master_pub,
+ &reserve_balance,
&withdraw_fee_balance,
- &reserve_balance));
+ &purse_fee_balance,
+ &history_fee_balance));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Test: update_reserve_summary\n");
@@ -289,25 +305,34 @@ run (void *cls)
plugin->update_reserve_summary (plugin->cls,
&master_pub,
&reserve_balance,
- &withdraw_fee_balance));
+ &withdraw_fee_balance,
+ &purse_fee_balance,
+ &history_fee_balance));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Test: get_reserve_summary\n");
ZR_BLK (&reserve_balance2);
ZR_BLK (&withdraw_fee_balance2);
+ ZR_BLK (&purse_fee_balance2);
+ ZR_BLK (&history_fee_balance2);
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_reserve_summary (plugin->cls,
&master_pub,
&reserve_balance2,
- &withdraw_fee_balance2));
-
- FAILIF ( (0 != GNUNET_memcmp (&reserve_balance2,
- &reserve_balance) ||
- (0 != GNUNET_memcmp (&withdraw_fee_balance2,
- &withdraw_fee_balance)) ) );
-
+ &withdraw_fee_balance2,
+ &purse_fee_balance2,
+ &history_fee_balance2));
+
+ FAILIF ( (0 != TALER_amount_cmp (&reserve_balance2,
+ &reserve_balance) ||
+ (0 != TALER_amount_cmp (&withdraw_fee_balance2,
+ &withdraw_fee_balance)) ||
+ (0 != TALER_amount_cmp (&purse_fee_balance2,
+ &purse_fee_balance)) ||
+ (0 != TALER_amount_cmp (&history_fee_balance2,
+ &history_fee_balance))));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Test: insert_denomination_balance\n");
@@ -488,7 +513,7 @@ run (void *cls)
int
select_historic_denom_revenue_result (
void *cls,
- const struct TALER_DenominationHash *denom_pub_hash2,
+ const struct TALER_DenominationHashP *denom_pub_hash2,
struct GNUNET_TIME_Timestamp revenue_timestamp2,
const struct TALER_Amount *revenue_balance2,
const struct TALER_Amount *loss2)