aboutsummaryrefslogtreecommitdiff
path: root/src/auditordb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-08-20 22:06:11 +0200
committerChristian Grothoff <christian@grothoff.org>2024-08-20 22:06:11 +0200
commit8ee82f195d4b99baec27537d9942e0ef73ac9aab (patch)
tree12c2075ae5dfb420b9df6695133271d165cdfc44 /src/auditordb
parent74eb9c4974f975c959985ccb8d98478e2386c3da (diff)
downloadexchange-8ee82f195d4b99baec27537d9942e0ef73ac9aab.tar.xz
-fix auditor FTBFS
Diffstat (limited to 'src/auditordb')
-rw-r--r--src/auditordb/pg_select_historic_denom_revenue.c10
-rw-r--r--src/auditordb/pg_select_historic_denom_revenue.h2
-rw-r--r--src/auditordb/pg_select_historic_reserve_revenue.c10
-rw-r--r--src/auditordb/pg_select_historic_reserve_revenue.h2
4 files changed, 22 insertions, 2 deletions
diff --git a/src/auditordb/pg_select_historic_denom_revenue.c b/src/auditordb/pg_select_historic_denom_revenue.c
index aa44625e7..e89841df0 100644
--- a/src/auditordb/pg_select_historic_denom_revenue.c
+++ b/src/auditordb/pg_select_historic_denom_revenue.c
@@ -72,11 +72,14 @@ historic_denom_revenue_cb (void *cls,
for (unsigned int i = 0; i < num_results; i++)
{
+ uint64_t rowid;
struct TALER_DenominationHashP denom_pub_hash;
struct GNUNET_TIME_Timestamp revenue_timestamp;
struct TALER_Amount revenue_balance;
struct TALER_Amount loss;
struct GNUNET_PQ_ResultSpec rs[] = {
+ GNUNET_PQ_result_spec_uint64 ("row_id",
+ &rowid),
GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash",
&denom_pub_hash),
GNUNET_PQ_result_spec_timestamp ("revenue_timestamp",
@@ -101,6 +104,7 @@ historic_denom_revenue_cb (void *cls,
hrc->qs = i + 1;
if (GNUNET_OK !=
hrc->cb (hrc->cb_cls,
+ rowid,
&denom_pub_hash,
revenue_timestamp,
&revenue_balance,
@@ -113,6 +117,8 @@ historic_denom_revenue_cb (void *cls,
enum GNUNET_DB_QueryStatus
TAH_PG_select_historic_denom_revenue (
void *cls,
+ int64_t limit,
+ uint64_t offset,
TALER_AUDITORDB_HistoricDenominationRevenueDataCallback cb,
void *cb_cls)
{
@@ -127,10 +133,12 @@ TAH_PG_select_historic_denom_revenue (
};
enum GNUNET_DB_QueryStatus qs;
+ // FIXME: implement limit/offset!
PREPARE (pg,
"auditor_historic_denomination_revenue_select",
"SELECT"
- " denom_pub_hash"
+ " row_id"
+ ",denom_pub_hash"
",revenue_timestamp"
",revenue_balance"
",loss_balance"
diff --git a/src/auditordb/pg_select_historic_denom_revenue.h b/src/auditordb/pg_select_historic_denom_revenue.h
index 25a68dacb..621c7d38d 100644
--- a/src/auditordb/pg_select_historic_denom_revenue.h
+++ b/src/auditordb/pg_select_historic_denom_revenue.h
@@ -37,6 +37,8 @@
enum GNUNET_DB_QueryStatus
TAH_PG_select_historic_denom_revenue (
void *cls,
+ int64_t limit,
+ uint64_t offset,
TALER_AUDITORDB_HistoricDenominationRevenueDataCallback cb,
void *cb_cls);
diff --git a/src/auditordb/pg_select_historic_reserve_revenue.c b/src/auditordb/pg_select_historic_reserve_revenue.c
index 877c3e2d7..d3366529e 100644
--- a/src/auditordb/pg_select_historic_reserve_revenue.c
+++ b/src/auditordb/pg_select_historic_reserve_revenue.c
@@ -72,10 +72,13 @@ historic_reserve_revenue_cb (void *cls,
for (unsigned int i = 0; i < num_results; i++)
{
+ uint64_t rowid;
struct GNUNET_TIME_Timestamp start_date;
struct GNUNET_TIME_Timestamp end_date;
struct TALER_Amount reserve_profits;
struct GNUNET_PQ_ResultSpec rs[] = {
+ GNUNET_PQ_result_spec_uint64 ("row_id",
+ &rowid),
GNUNET_PQ_result_spec_timestamp ("start_date",
&start_date),
GNUNET_PQ_result_spec_timestamp ("end_date",
@@ -97,6 +100,7 @@ historic_reserve_revenue_cb (void *cls,
hrc->qs = i + 1;
if (GNUNET_OK !=
hrc->cb (hrc->cb_cls,
+ rowid,
start_date,
end_date,
&reserve_profits))
@@ -108,6 +112,8 @@ historic_reserve_revenue_cb (void *cls,
enum GNUNET_DB_QueryStatus
TAH_PG_select_historic_reserve_revenue (
void *cls,
+ int64_t limit,
+ uint64_t offset,
TALER_AUDITORDB_HistoricReserveRevenueDataCallback cb,
void *cb_cls)
{
@@ -122,10 +128,12 @@ TAH_PG_select_historic_reserve_revenue (
.pg = pg
};
+ // FIXME: use limit/offset!
PREPARE (pg,
"auditor_historic_reserve_summary_select",
"SELECT"
- " start_date"
+ " row_id"
+ ",start_date"
",end_date"
",reserve_profits"
" FROM auditor_historic_reserve_summary");
diff --git a/src/auditordb/pg_select_historic_reserve_revenue.h b/src/auditordb/pg_select_historic_reserve_revenue.h
index b067c8917..e9190e35b 100644
--- a/src/auditordb/pg_select_historic_reserve_revenue.h
+++ b/src/auditordb/pg_select_historic_reserve_revenue.h
@@ -36,6 +36,8 @@
enum GNUNET_DB_QueryStatus
TAH_PG_select_historic_reserve_revenue (
void *cls,
+ int64_t limit,
+ uint64_t offset,
TALER_AUDITORDB_HistoricReserveRevenueDataCallback cb,
void *cb_cls);