gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated (0efc7fd5 -> 3d4e5806)


From: gnunet
Subject: [taler-exchange] branch master updated (0efc7fd5 -> 3d4e5806)
Date: Mon, 28 Feb 2022 22:41:27 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository exchange.

    from 0efc7fd5 cleaner sql
     new ee79f312 -work on test_sync.sh, incomplete
     new 3d4e5806 work on auditor-sync update to latest DB

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/auditor/test-sync.sh                    |  3 ++-
 src/exchangedb/exchange-0001.sql            |  1 +
 src/exchangedb/irbt_callbacks.c             | 18 ++++++++++--------
 src/exchangedb/lrbt_callbacks.c             |  8 ++++++--
 src/exchangedb/plugin_exchangedb_postgres.c | 20 +++++++++++++-------
 src/include/taler_exchangedb_plugin.h       |  3 ++-
 6 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/src/auditor/test-sync.sh b/src/auditor/test-sync.sh
index 24de92eb..a69201a8 100755
--- a/src/auditor/test-sync.sh
+++ b/src/auditor/test-sync.sh
@@ -18,7 +18,8 @@ psql talercheck-in < auditor-basedb.sql >/dev/null 2> 
/dev/null
 echo -n "."
 taler-auditor-sync -s test-sync-in.conf -d test-sync-out.conf -t
 
-for table in denominations denomination_revocations reserves reserves_in 
reserves_close reserves_out auditors auditor_denom_sigs exchange_sign_keys 
signkey_revocations known_coins refresh_commitments refresh_revealed_coins 
refresh_transfer_keys deposits refunds wire_out aggregation_tracking wire_fee 
recoup recoup_refresh
+# cs_nonce_locks excluded: no point
+for table in denominations denomination_revocations wire_targets reserves 
reserves_in reserves_close reserves_out auditors auditor_denom_sigs 
exchange_sign_keys signkey_revocations extensions extension_details known_coins 
refresh_commitments refresh_revealed_coins refresh_transfer_keys deposits 
refunds wire_out aggregation_tracking wire_fee recoup recoup_refresh
 do
     echo -n "."
     CIN=`echo "SELECT COUNT(*) FROM $table" | psql talercheck-in -Aqt`
diff --git a/src/exchangedb/exchange-0001.sql b/src/exchangedb/exchange-0001.sql
index 821c2d9e..118265b5 100644
--- a/src/exchangedb/exchange-0001.sql
+++ b/src/exchangedb/exchange-0001.sql
@@ -2079,6 +2079,7 @@ UPDATE known_coins
   WHERE coin_pub=in_coin_pub;
 
 
+
 -- Credit the reserve and update reserve timers.
 UPDATE reserves
   SET
diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c
index 3673c7be..44acaf8a 100644
--- a/src/exchangedb/irbt_callbacks.c
+++ b/src/exchangedb/irbt_callbacks.c
@@ -39,6 +39,10 @@ irbt_cb_table_denominations (struct PostgresClosure *pg,
   struct GNUNET_PQ_QueryParam params[] = {
     GNUNET_PQ_query_param_uint64 (&td->serial),
     GNUNET_PQ_query_param_auto_from_type (&denom_hash),
+    GNUNET_PQ_query_param_uint32 (
+      &td->details.denominations.denom_type),
+    GNUNET_PQ_query_param_uint32 (
+      &td->details.denominations.age_mask),
     TALER_PQ_query_param_denom_pub (
       &td->details.denominations.denom_pub),
     GNUNET_PQ_query_param_auto_from_type (
@@ -260,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
   };
@@ -376,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
   };
 
@@ -500,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),
@@ -519,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 a14c212d..1f2ad604 100644
--- a/src/exchangedb/lrbt_callbacks.c
+++ b/src/exchangedb/lrbt_callbacks.c
@@ -53,8 +53,8 @@ lrbt_cb_table_denominations (void *cls,
         "denom_type",
         &td.details.denominations.denom_type),
       GNUNET_PQ_result_spec_uint32 (
-        "age_restrictions",
-        &td.details.denominations.age_restrictions),
+        "age_mask",
+        &td.details.denominations.age_mask),
       TALER_PQ_result_spec_denom_pub (
         "denom_pub",
         &td.details.denominations.denom_pub),
@@ -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 1ee401bc..12f18d0b 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -280,8 +280,9 @@ prepare_statements (struct PostgresClosure *pg)
       ",fee_refresh_frac"
       ",fee_refund_val"
       ",fee_refund_frac"
-      ",denom_pub"
+      ",denom_type"
       ",age_mask"
+      ",denom_pub"
       " FROM denominations"
       " LEFT JOIN "
       "   denomination_revocations USING (denominations_serial);",
@@ -2162,7 +2163,7 @@ prepare_statements (struct PostgresClosure *pg)
       ",h_blind_ev"
       ",denominations_serial"
       ",denom_sig"
-      ",reserve_pub"
+      ",reserve_uuid"
       ",reserve_sig"
       ",execution_date"
       ",amount_with_fee_val"
@@ -2226,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;",
@@ -2384,6 +2387,8 @@ prepare_statements (struct PostgresClosure *pg)
       "INSERT INTO denominations"
       "(denominations_serial"
       ",denom_pub_hash"
+      ",denom_type"
+      ",age_mask"
       ",denom_pub"
       ",master_sig"
       ",valid_from"
@@ -2400,11 +2405,10 @@ prepare_statements (struct PostgresClosure *pg)
       ",fee_refresh_frac"
       ",fee_refund_val"
       ",fee_refund_frac"
-      ",age_mask"
       ") VALUES "
       "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10,"
-      " $11, $12, $13, $14, $15, $16, $17, $18, $19);",
-      19),
+      " $11, $12, $13, $14, $15, $16, $17, $18, $19, $20);",
+      20),
     GNUNET_PQ_make_prepare (
       "insert_into_table_denomination_revocations",
       "INSERT INTO denomination_revocations"
@@ -2520,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 80cab782..846183ee 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -200,7 +200,7 @@ struct TALER_EXCHANGEDB_TableData
     struct
     {
       uint32_t denom_type;
-      uint32_t age_restrictions;
+      uint32_t age_mask;
       struct TALER_DenominationPublicKey denom_pub;
       struct TALER_MasterSignatureP master_sig;
       struct GNUNET_TIME_Timestamp valid_from;
@@ -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

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]