gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -more reserve history fixes


From: gnunet
Subject: [taler-exchange] branch master updated: -more reserve history fixes
Date: Mon, 23 May 2022 15:29:38 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new a509a91f -more reserve history fixes
a509a91f is described below

commit a509a91f924cad3b5f0336f78e5c80e3621ad52b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon May 23 15:29:35 2022 +0200

    -more reserve history fixes
---
 src/exchange/taler-exchange-httpd_purses_create.c  |  1 -
 src/exchange/taler-exchange-httpd_purses_deposit.c |  8 --------
 src/exchange/taler-exchange-httpd_reserves_purse.c |  1 -
 src/exchangedb/exchange-0001-part.sql              |  1 +
 src/include/taler_crypto_lib.h                     |  2 --
 src/include/taler_exchange_service.h               |  7 +------
 src/lib/exchange_api_purse_create_with_deposit.c   |  1 -
 src/lib/exchange_api_purse_deposit.c               |  3 ---
 src/testing/test_exchange_p2p.c                    |  4 ++--
 src/testing/testing_api_cmd_common.c               |  7 +++----
 src/testing/testing_api_cmd_purse_deposit.c        | 13 ++++++++++++-
 src/testing/testing_api_cmd_reserve_purse.c        |  8 ++++++++
 src/util/exchange_signatures.c                     |  9 ---------
 13 files changed, 27 insertions(+), 38 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_purses_create.c 
b/src/exchange/taler-exchange-httpd_purses_create.c
index f8293981..dba4fa4a 100644
--- a/src/exchange/taler-exchange-httpd_purses_create.c
+++ b/src/exchange/taler-exchange-httpd_purses_create.c
@@ -176,7 +176,6 @@ reply_create_success (struct MHD_Connection *connection,
          &pcc->amount,
          &pcc->deposit_total,
          pcc->purse_pub,
-         &pcc->merge_pub,
          &pcc->h_contract_terms,
          &pub,
          &sig)))
diff --git a/src/exchange/taler-exchange-httpd_purses_deposit.c 
b/src/exchange/taler-exchange-httpd_purses_deposit.c
index 38bd8472..f1f6ecab 100644
--- a/src/exchange/taler-exchange-httpd_purses_deposit.c
+++ b/src/exchange/taler-exchange-httpd_purses_deposit.c
@@ -97,11 +97,6 @@ struct PurseDepositContext
    */
   struct GNUNET_TIME_Timestamp purse_expiration;
 
-  /**
-   * Key with the merge capability (needed for signing).
-   */
-  struct TALER_PurseMergePublicKeyP merge_pub;
-
   /**
    * Hash of the contract (needed for signing).
    */
@@ -152,7 +147,6 @@ reply_deposit_success (struct MHD_Connection *connection,
          &pcc->amount,
          &pcc->deposit_total,
          pcc->purse_pub,
-         &pcc->merge_pub,
          &pcc->h_contract_terms,
          &pub,
          &sig)))
@@ -175,8 +169,6 @@ reply_deposit_success (struct MHD_Connection *connection,
                                 pcc->purse_expiration),
     GNUNET_JSON_pack_data_auto ("h_contract_terms",
                                 &pcc->h_contract_terms),
-    GNUNET_JSON_pack_data_auto ("merge_pub",
-                                &pcc->merge_pub),
     GNUNET_JSON_pack_data_auto ("exchange_sig",
                                 &sig),
     GNUNET_JSON_pack_data_auto ("exchange_pub",
diff --git a/src/exchange/taler-exchange-httpd_reserves_purse.c 
b/src/exchange/taler-exchange-httpd_reserves_purse.c
index 77321b2c..b4035b55 100644
--- a/src/exchange/taler-exchange-httpd_reserves_purse.c
+++ b/src/exchange/taler-exchange-httpd_reserves_purse.c
@@ -165,7 +165,6 @@ reply_purse_success (struct MHD_Connection *connection,
          &rpc->amount,
          &rpc->deposit_total,
          &rpc->purse_pub,
-         &rpc->merge_pub,
          &rpc->h_contract_terms,
          &pub,
          &sig)))
diff --git a/src/exchangedb/exchange-0001-part.sql 
b/src/exchangedb/exchange-0001-part.sql
index 21810034..9b9828fe 100644
--- a/src/exchangedb/exchange-0001-part.sql
+++ b/src/exchangedb/exchange-0001-part.sql
@@ -3071,6 +3071,7 @@ ELSE
   WHERE reserve_pub=my_reserve_pub;
 
   -- ... and mark purse as finished.
+  -- FIXME: combine with UPDATE above?
   UPDATE purse_requests
      SET finished=true
   WHERE purse_pub=in_purse_pub;
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 3c413aaf..5cc28db0 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -3974,7 +3974,6 @@ TALER_exchange_online_purse_created_sign (
   const struct TALER_Amount *amount_without_fee,
   const struct TALER_Amount *total_deposited,
   const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const struct TALER_PurseMergePublicKeyP *merge_pub,
   const struct TALER_PrivateContractHashP *h_contract_terms,
   struct TALER_ExchangePublicKeyP *pub,
   struct TALER_ExchangeSignatureP *sig);
@@ -3987,7 +3986,6 @@ TALER_exchange_online_purse_created_verify (
   const struct TALER_Amount *amount_without_fee,
   const struct TALER_Amount *total_deposited,
   const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const struct TALER_PurseMergePublicKeyP *merge_pub,
   const struct TALER_PrivateContractHashP *h_contract_terms,
   const struct TALER_ExchangePublicKeyP *pub,
   const struct TALER_ExchangeSignatureP *sig);
diff --git a/src/include/taler_exchange_service.h 
b/src/include/taler_exchange_service.h
index 634e7832..ecb74bd6 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -4240,7 +4240,7 @@ TALER_EXCHANGE_purse_get (
 
 
 /**
- * Cancel #TALER_EXCHANGE_purse_deposit() operation.
+ * Cancel #TALER_EXCHANGE_purse_get() operation.
  *
  * @param pgh handle of the operation to cancel
  */
@@ -4628,11 +4628,6 @@ struct TALER_EXCHANGE_PurseDepositResponse
        */
       struct TALER_PrivateContractHashP h_contract_terms;
 
-      /**
-       * Key with the merge capability (needed to verify signature).
-       */
-      struct TALER_PurseMergePublicKeyP merge_pub;
-
     } success;
   } details;
 
diff --git a/src/lib/exchange_api_purse_create_with_deposit.c 
b/src/lib/exchange_api_purse_create_with_deposit.c
index 60f0f736..42dd6914 100644
--- a/src/lib/exchange_api_purse_create_with_deposit.c
+++ b/src/lib/exchange_api_purse_create_with_deposit.c
@@ -170,7 +170,6 @@ handle_purse_create_deposit_finished (void *cls,
             &pch->purse_value_after_fees,
             &total_deposited,
             &pch->purse_pub,
-            &pch->merge_pub,
             &pch->h_contract_terms,
             &exchange_pub,
             &exchange_sig))
diff --git a/src/lib/exchange_api_purse_deposit.c 
b/src/lib/exchange_api_purse_deposit.c
index 67f5355d..3ed523b6 100644
--- a/src/lib/exchange_api_purse_deposit.c
+++ b/src/lib/exchange_api_purse_deposit.c
@@ -152,8 +152,6 @@ handle_purse_deposit_finished (void *cls,
                                      &exchange_sig),
         GNUNET_JSON_spec_fixed_auto ("exchange_pub",
                                      &exchange_pub),
-        GNUNET_JSON_spec_fixed_auto ("merge_pub",
-                                     &dr.details.success.merge_pub),
         GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
                                      &dr.details.success.h_contract_terms),
         GNUNET_JSON_spec_timestamp ("exchange_timestamp",
@@ -195,7 +193,6 @@ handle_purse_deposit_finished (void *cls,
             &dr.details.success.purse_value_after_fees,
             &dr.details.success.total_deposited,
             &pch->purse_pub,
-            &dr.details.success.merge_pub,
             &dr.details.success.h_contract_terms,
             &exchange_pub,
             &exchange_sig))
diff --git a/src/testing/test_exchange_p2p.c b/src/testing/test_exchange_p2p.c
index aad0465b..2f82d124 100644
--- a/src/testing/test_exchange_p2p.c
+++ b/src/testing/test_exchange_p2p.c
@@ -251,9 +251,9 @@ run (void *cls,
       "create-reserve-1",
       "EUR:2",
       MHD_HTTP_OK),
-#if FIXME
+#if 1
     /* POST history doesn't yet support P2P transfers */
-    TALER_TESTING_cmd_reserves_status (
+    TALER_TESTING_cmd_reserve_status (
       "push-check-post-merge-reserve-balance-post",
       "create-reserve-1",
       "EUR:2",
diff --git a/src/testing/testing_api_cmd_common.c 
b/src/testing/testing_api_cmd_common.c
index 1e243937..138e5502 100644
--- a/src/testing/testing_api_cmd_common.c
+++ b/src/testing/testing_api_cmd_common.c
@@ -26,10 +26,9 @@
 
 
 int
-TALER_TESTING_history_entry_cmp (const struct
-                                 TALER_EXCHANGE_ReserveHistoryEntry *h1,
-                                 const struct
-                                 TALER_EXCHANGE_ReserveHistoryEntry *h2)
+TALER_TESTING_history_entry_cmp (
+  const struct TALER_EXCHANGE_ReserveHistoryEntry *h1,
+  const struct TALER_EXCHANGE_ReserveHistoryEntry *h2)
 {
   if (h1->type != h2->type)
     return 1;
diff --git a/src/testing/testing_api_cmd_purse_deposit.c 
b/src/testing/testing_api_cmd_purse_deposit.c
index 86ed1b18..1c6dcdd9 100644
--- a/src/testing/testing_api_cmd_purse_deposit.c
+++ b/src/testing/testing_api_cmd_purse_deposit.c
@@ -159,6 +159,7 @@ deposit_cb (void *cls,
       const struct TALER_ReserveSignatureP *reserve_sig;
       const struct TALER_ReservePublicKeyP *reserve_pub;
       const struct GNUNET_TIME_Timestamp *merge_timestamp;
+      const struct TALER_PurseMergePublicKeyP *merge_pub;
 
       purse_cmd = TALER_TESTING_interpreter_lookup_command (ds->is,
                                                             ds->purse_ref);
@@ -179,6 +180,14 @@ deposit_cb (void *cls,
         TALER_TESTING_interpreter_fail (ds->is);
         return;
       }
+      if (GNUNET_OK !=
+          TALER_TESTING_get_trait_merge_pub (purse_cmd,
+                                             &merge_pub))
+      {
+        GNUNET_break (0);
+        TALER_TESTING_interpreter_fail (ds->is);
+        return;
+      }
       ds->reserve_pub = *reserve_pub;
       if (GNUNET_OK !=
           TALER_TESTING_get_trait_timestamp (purse_cmd,
@@ -213,7 +222,9 @@ deposit_cb (void *cls,
       ds->reserve_history.details.merge_details.h_contract_terms
         = dr->details.success.h_contract_terms;
       ds->reserve_history.details.merge_details.merge_pub
-        = dr->details.success.merge_pub;
+        = *merge_pub;
+      ds->reserve_history.details.merge_details.purse_pub
+        = ds->purse_pub;
       ds->reserve_history.details.merge_details.reserve_sig
         = *reserve_sig;
       ds->reserve_history.details.merge_details.merge_timestamp
diff --git a/src/testing/testing_api_cmd_reserve_purse.c 
b/src/testing/testing_api_cmd_reserve_purse.c
index ffdd0005..42aff80e 100644
--- a/src/testing/testing_api_cmd_reserve_purse.c
+++ b/src/testing/testing_api_cmd_reserve_purse.c
@@ -72,6 +72,11 @@ struct ReservePurseState
    */
   struct TALER_PurseMergePrivateKeyP merge_priv;
 
+  /**
+   * Public key of the merge capability.
+   */
+  struct TALER_PurseMergePublicKeyP merge_pub;
+
   /**
    * Private key to decrypt the contract.
    */
@@ -184,6 +189,8 @@ purse_run (void *cls,
   GNUNET_CRYPTO_eddsa_key_get_public (&ds->reserve_priv.eddsa_priv,
                                       &ds->reserve_pub.eddsa_pub);
   GNUNET_CRYPTO_eddsa_key_create (&ds->merge_priv.eddsa_priv);
+  GNUNET_CRYPTO_eddsa_key_get_public (&ds->merge_priv.eddsa_priv,
+                                      &ds->merge_pub.eddsa_pub);
   GNUNET_CRYPTO_ecdhe_key_create (&ds->contract_priv.ecdhe_priv);
   ds->purse_expiration = GNUNET_TIME_absolute_to_timestamp (
     GNUNET_TIME_relative_to_absolute (ds->expiration_rel));
@@ -266,6 +273,7 @@ purse_traits (void *cls,
     TALER_TESTING_make_trait_purse_priv (&ds->purse_priv),
     TALER_TESTING_make_trait_purse_pub (&ds->purse_pub),
     TALER_TESTING_make_trait_merge_priv (&ds->merge_priv),
+    TALER_TESTING_make_trait_merge_pub (&ds->merge_pub),
     TALER_TESTING_make_trait_contract_priv (&ds->contract_priv),
     TALER_TESTING_make_trait_reserve_priv (&ds->reserve_priv),
     TALER_TESTING_make_trait_reserve_pub (&ds->reserve_pub),
diff --git a/src/util/exchange_signatures.c b/src/util/exchange_signatures.c
index 5c72289e..68c0fdb0 100644
--- a/src/util/exchange_signatures.c
+++ b/src/util/exchange_signatures.c
@@ -1300,11 +1300,6 @@ struct TALER_PurseCreateDepositConfirmationPS
    */
   struct TALER_PurseContractPublicKeyP purse_pub;
 
-  /**
-   * Public key of the merge capability.
-   */
-  struct TALER_PurseMergePublicKeyP merge_pub;
-
   /**
    * Hash of the contract of the purse.
    */
@@ -1323,7 +1318,6 @@ TALER_exchange_online_purse_created_sign (
   const struct TALER_Amount *amount_without_fee,
   const struct TALER_Amount *total_deposited,
   const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const struct TALER_PurseMergePublicKeyP *merge_pub,
   const struct TALER_PrivateContractHashP *h_contract_terms,
   struct TALER_ExchangePublicKeyP *pub,
   struct TALER_ExchangeSignatureP *sig)
@@ -1333,7 +1327,6 @@ TALER_exchange_online_purse_created_sign (
     .purpose.size = htonl (sizeof (dc)),
     .h_contract_terms = *h_contract_terms,
     .purse_pub = *purse_pub,
-    .merge_pub = *merge_pub,
     .purse_expiration = GNUNET_TIME_timestamp_hton (purse_expiration),
     .exchange_time = GNUNET_TIME_timestamp_hton (exchange_time)
   };
@@ -1355,7 +1348,6 @@ TALER_exchange_online_purse_created_verify (
   const struct TALER_Amount *amount_without_fee,
   const struct TALER_Amount *total_deposited,
   const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const struct TALER_PurseMergePublicKeyP *merge_pub,
   const struct TALER_PrivateContractHashP *h_contract_terms,
   const struct TALER_ExchangePublicKeyP *pub,
   const struct TALER_ExchangeSignatureP *sig)
@@ -1365,7 +1357,6 @@ TALER_exchange_online_purse_created_verify (
     .purpose.size = htonl (sizeof (dc)),
     .h_contract_terms = *h_contract_terms,
     .purse_pub = *purse_pub,
-    .merge_pub = *merge_pub,
     .purse_expiration = GNUNET_TIME_timestamp_hton (purse_expiration),
     .exchange_time = GNUNET_TIME_timestamp_hton (exchange_time)
   };

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