work on auditor-sync update to latest DB

This commit is contained in:
Christian Grothoff 2022-02-28 22:41:21 +01:00
parent ee79f31275
commit 3d4e580699
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
4 changed files with 17 additions and 10 deletions

View File

@ -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

View File

@ -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
};

View File

@ -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"

View File

@ -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