summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-28 22:41:21 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-28 22:41:24 +0100
commit3d4e580699107fcd8d5df0fa02c097de5d168694 (patch)
treed2328fde9d111b8c1c68e329cbb064e1df7dd9e4 /src
parentee79f312754304d15704e122970223f28759fceb (diff)
downloadexchange-3d4e580699107fcd8d5df0fa02c097de5d168694.tar.gz
exchange-3d4e580699107fcd8d5df0fa02c097de5d168694.tar.bz2
exchange-3d4e580699107fcd8d5df0fa02c097de5d168694.zip
work on auditor-sync update to latest DB
Diffstat (limited to 'src')
-rw-r--r--src/exchangedb/irbt_callbacks.c14
-rw-r--r--src/exchangedb/lrbt_callbacks.c4
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c8
-rw-r--r--src/include/taler_exchangedb_plugin.h1
4 files changed, 17 insertions, 10 deletions
diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c
index 821ebac86..44acaf8aa 100644
--- a/src/exchangedb/irbt_callbacks.c
+++ b/src/exchangedb/irbt_callbacks.c
@@ -264,13 +264,12 @@ static enum GNUNET_DB_QueryStatus
irbt_cb_table_auditors (struct PostgresClosure *pg,
const struct TALER_EXCHANGEDB_TableData *td)
{
- uint8_t is_active = td->details.auditors.is_active ? 1 : 0;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&td->serial),
GNUNET_PQ_query_param_auto_from_type (&td->details.auditors.auditor_pub),
GNUNET_PQ_query_param_string (td->details.auditors.auditor_name),
GNUNET_PQ_query_param_string (td->details.auditors.auditor_url),
- GNUNET_PQ_query_param_auto_from_type (&is_active),
+ GNUNET_PQ_query_param_bool (&td->details.auditors.is_active),
GNUNET_PQ_query_param_timestamp (&td->details.auditors.last_change),
GNUNET_PQ_query_param_end
};
@@ -380,6 +379,8 @@ irbt_cb_table_known_coins (struct PostgresClosure *pg,
&td->details.known_coins.denom_sig),
GNUNET_PQ_query_param_uint64 (
&td->details.known_coins.denominations_serial),
+ TALER_PQ_query_param_amount (
+ &td->details.known_coins.remaining),
GNUNET_PQ_query_param_end
};
@@ -504,9 +505,6 @@ static enum GNUNET_DB_QueryStatus
irbt_cb_table_deposits (struct PostgresClosure *pg,
const struct TALER_EXCHANGEDB_TableData *td)
{
- uint8_t tiny = td->details.deposits.tiny ? 1 : 0;
- uint8_t done = td->details.deposits.done ? 1 : 0;
- uint8_t extension_blocked = td->details.deposits.extension_blocked ? 1 : 0;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&td->serial),
GNUNET_PQ_query_param_uint64 (&td->details.deposits.shard),
@@ -523,9 +521,9 @@ irbt_cb_table_deposits (struct PostgresClosure *pg,
GNUNET_PQ_query_param_auto_from_type (&td->details.deposits.coin_sig),
GNUNET_PQ_query_param_auto_from_type (&td->details.deposits.wire_salt),
GNUNET_PQ_query_param_uint64 (&td->details.deposits.wire_target_serial_id),
- GNUNET_PQ_query_param_auto_from_type (&tiny),
- GNUNET_PQ_query_param_auto_from_type (&done),
- GNUNET_PQ_query_param_auto_from_type (&extension_blocked),
+ GNUNET_PQ_query_param_bool (td->details.deposits.tiny),
+ GNUNET_PQ_query_param_bool (td->details.deposits.done),
+ GNUNET_PQ_query_param_bool (td->details.deposits.extension_blocked),
GNUNET_PQ_query_param_uint64 (
&td->details.deposits.extension_details_serial_id),
GNUNET_PQ_query_param_end
diff --git a/src/exchangedb/lrbt_callbacks.c b/src/exchangedb/lrbt_callbacks.c
index 74b99cd4f..1f2ad6046 100644
--- a/src/exchangedb/lrbt_callbacks.c
+++ b/src/exchangedb/lrbt_callbacks.c
@@ -658,6 +658,7 @@ lrbt_cb_table_known_coins (void *cls,
unsigned int num_results)
{
struct LookupRecordsByTableContext *ctx = cls;
+ struct PostgresClosure *pg = ctx->pg;
struct TALER_EXCHANGEDB_TableData td = {
.table = TALER_EXCHANGEDB_RT_KNOWN_COINS
};
@@ -677,6 +678,9 @@ lrbt_cb_table_known_coins (void *cls,
GNUNET_PQ_result_spec_uint64 (
"denominations_serial",
&td.details.known_coins.denominations_serial),
+ TALER_PQ_RESULT_SPEC_AMOUNT (
+ "remaining",
+ &td.details.known_coins.remaining),
GNUNET_PQ_result_spec_end
};
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index b9e5bc8f9..12f18d0be 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -2227,6 +2227,8 @@ prepare_statements (struct PostgresClosure *pg)
",coin_pub"
",denom_sig"
",denominations_serial"
+ ",remaining_val"
+ ",remaining_frac"
" FROM known_coins"
" WHERE known_coin_id > $1"
" ORDER BY known_coin_id ASC;",
@@ -2522,9 +2524,11 @@ prepare_statements (struct PostgresClosure *pg)
",coin_pub"
",denom_sig"
",denominations_serial"
+ ",remaining_val"
+ ",remaining_frac"
") VALUES "
- "($1, $2, $3, $4);",
- 4),
+ "($1, $2, $3, $4, $5, $6);",
+ 6),
GNUNET_PQ_make_prepare (
"insert_into_table_refresh_commitments",
"INSERT INTO refresh_commitments"
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index 6e3008ad0..846183ee5 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -301,6 +301,7 @@ struct TALER_EXCHANGEDB_TableData
struct TALER_AgeCommitmentHash age_hash;
uint64_t denominations_serial;
struct TALER_DenominationSignature denom_sig;
+ struct TALER_Amount remaining;
} known_coins;
struct