gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] 01/24: -work on fixing FTBFS


From: gnunet
Subject: [taler-merchant] 01/24: -work on fixing FTBFS
Date: Wed, 17 Nov 2021 12:44:24 +0100

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

grothoff pushed a commit to branch master
in repository merchant.

commit ca71aefbb1e1520b0e4b357c0b1d9c6aaf0d5128
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Oct 28 00:01:13 2021 +0200

    -work on fixing FTBFS
---
 contrib/merchant-backoffice                        |  2 +-
 src/backend/taler-merchant-httpd.h                 |  2 +-
 src/backend/taler-merchant-httpd_auditors.c        |  2 +-
 src/backend/taler-merchant-httpd_get-orders-ID.c   | 12 ++--
 src/backend/taler-merchant-httpd_get-orders-ID.h   |  2 +-
 .../taler-merchant-httpd_post-orders-ID-abort.c    |  6 +-
 .../taler-merchant-httpd_post-orders-ID-paid.c     |  2 +-
 .../taler-merchant-httpd_post-orders-ID-pay.c      | 23 +++----
 .../taler-merchant-httpd_post-orders-ID-refund.c   |  5 +-
 ...r-merchant-httpd_private-get-instances-ID-kyc.c | 13 ++--
 .../taler-merchant-httpd_private-get-orders-ID.c   | 10 +--
 .../taler-merchant-httpd_private-get-orders.c      |  2 +-
 ...-merchant-httpd_private-post-orders-ID-refund.c |  2 +-
 .../taler-merchant-httpd_private-post-orders.c     |  2 +-
 .../taler-merchant-httpd_private-post-transfers.c  |  2 +-
 src/backenddb/plugin_merchantdb_postgres.c         | 77 ++++++++++++----------
 src/include/taler_merchantdb_plugin.h              | 39 ++++++-----
 17 files changed, 104 insertions(+), 99 deletions(-)

diff --git a/contrib/merchant-backoffice b/contrib/merchant-backoffice
index 182cdfff..824aa7a8 160000
--- a/contrib/merchant-backoffice
+++ b/contrib/merchant-backoffice
@@ -1 +1 @@
-Subproject commit 182cdfffa1d4b6f2bb3543d30cfa7509e73bda03
+Subproject commit 824aa7a80b4c2e63d23985751f34c9492d396a36
diff --git a/src/backend/taler-merchant-httpd.h 
b/src/backend/taler-merchant-httpd.h
index 3fe35130..1b18cdd4 100644
--- a/src/backend/taler-merchant-httpd.h
+++ b/src/backend/taler-merchant-httpd.h
@@ -63,7 +63,7 @@ struct TMH_WireMethod
   /**
    * Hash of our wire format details as given in #j_wire.
    */
-  struct GNUNET_HashCode h_wire;
+  struct TALER_MerchantWireHash h_wire;
 
   /**
    * Is this wire method active (should it be included in new contracts)?
diff --git a/src/backend/taler-merchant-httpd_auditors.c 
b/src/backend/taler-merchant-httpd_auditors.c
index 1a0f6273..e693935e 100644
--- a/src/backend/taler-merchant-httpd_auditors.c
+++ b/src/backend/taler-merchant-httpd_auditors.c
@@ -120,7 +120,7 @@ TMH_AUDITORS_check_dk (struct TALER_EXCHANGE_Handle *mh,
   }
   GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
               "Denomination key %s offered by client not audited by any 
accepted auditor\n",
-              GNUNET_h2s (&dk->h_key));
+              GNUNET_h2s (&dk->h_key.hash));
   *hc = MHD_HTTP_BAD_REQUEST;
   *ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_KEY_AUDITOR_FAILURE;
   return GNUNET_NO;
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c 
b/src/backend/taler-merchant-httpd_get-orders-ID.c
index dbb5ef10..cc385e4a 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.c
@@ -47,7 +47,7 @@ struct GetOrderData
   /**
    * Hashed version of contract terms. All zeros if not provided.
    */
-  struct GNUNET_HashCode h_contract_terms;
+  struct TALER_PrivateContractHash h_contract_terms;
 
   /**
    * Claim token used for access control. All zeros if not provided.
@@ -363,7 +363,7 @@ TMH_make_order_status_url (struct MHD_Connection *con,
                            const char *session_id,
                            const char *instance_id,
                            struct TALER_ClaimTokenP *claim_token,
-                           struct GNUNET_HashCode *h_contract)
+                           struct TALER_PrivateContractHash *h_contract)
 {
   const char *host;
   const char *forwarded_host;
@@ -832,7 +832,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
       if ( (NULL != cts) &&
            (GNUNET_OK !=
             GNUNET_CRYPTO_hash_from_string (cts,
-                                            &god->h_contract_terms)) )
+                                            &god->h_contract_terms.hash)) )
       {
         /* cts has wrong encoding */
         GNUNET_break_op (0);
@@ -1049,7 +1049,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
   /* Check if client provided the right hash code of the contract terms */
   if (NULL != god->contract_terms)
   {
-    struct GNUNET_HashCode h;
+    struct TALER_PrivateContractHash h;
 
     contract_available = true;
     if (GNUNET_OK !=
@@ -1085,7 +1085,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
   else
   {
     struct TALER_ClaimTokenP db_claim_token;
-    struct GNUNET_HashCode unused;
+    struct GNUNET_HashCode unused; /* h_post_data */
 
     qs = TMH_db->lookup_order (TMH_db->cls,
                                hc->instance->settings.id,
@@ -1305,7 +1305,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
 
   {
     /* Check if paid. */
-    struct GNUNET_HashCode h_contract;
+    struct TALER_PrivateContractHash h_contract;
     bool paid;
 
     qs = TMH_db->lookup_order_status (TMH_db->cls,
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.h 
b/src/backend/taler-merchant-httpd_get-orders-ID.h
index 67dd2a1a..a09d40a3 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.h
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.h
@@ -67,7 +67,7 @@ TMH_make_order_status_url (struct MHD_Connection *con,
                            const char *session_id,
                            const char *instance_id,
                            struct TALER_ClaimTokenP *claim_token,
-                           struct GNUNET_HashCode *h_contract);
+                           struct TALER_PrivateContractHash *h_contract);
 
 
 /**
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c 
b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
index ce17063e..e3afaffb 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
@@ -126,7 +126,7 @@ struct AbortContext
   /**
    * Hashed contract terms (according to client).
    */
-  struct GNUNET_HashCode h_contract_terms;
+  struct TALER_PrivateContractHash h_contract_terms;
 
   /**
    * Context for our operation.
@@ -746,7 +746,7 @@ begin_transaction (struct AbortContext *ac)
   /* check payment was indeed incomplete
      (now that we are in the transaction scope!) */
   {
-    struct GNUNET_HashCode h_contract_terms;
+    struct TALER_PrivateContractHash h_contract_terms;
     bool paid;
 
     qs = TMH_db->lookup_order_status (TMH_db->cls,
@@ -940,7 +940,7 @@ parse_abort (struct MHD_Connection *connection,
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Handling /abort for order `%s' with contract hash `%s'\n",
               ac->hc->infix,
-              GNUNET_h2s (&ac->h_contract_terms));
+              GNUNET_h2s (&ac->h_contract_terms.hash));
   return GNUNET_OK;
 }
 
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c 
b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
index 52f233eb..7b1a7863 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
@@ -151,7 +151,7 @@ TMH_post_orders_ID_paid (const struct TMH_RequestHandler 
*rh,
   }
 
   {
-    struct GNUNET_HashCode h_contract_terms;
+    struct TALER_PrivateContractHash h_contract_terms;
 
     if (GNUNET_OK !=
         TALER_JSON_contract_hash (contract_terms,
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c 
b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
index fa372fe0..04d174eb 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -76,7 +76,7 @@ struct DepositConfirmation
   /**
    * Hash of the denomination of this coin.
    */
-  struct GNUNET_HashCode h_denom;
+  struct TALER_DenominationHash h_denom;
 
   /**
    * Amount this coin contributes to the total purchase price.
@@ -218,13 +218,13 @@ struct PayContext
   /**
    * Hashed proposal.
    */
-  struct GNUNET_HashCode h_contract_terms;
+  struct TALER_PrivateContractHash h_contract_terms;
 
   /**
    * "h_wire" from @e contract_terms.  Used to identify
    * the instance's wire transfer method.
    */
-  struct GNUNET_HashCode h_wire;
+  struct TALER_MerchantWireHash h_wire;
 
   /**
    * Maximum fee the merchant is willing to pay, from @e root.
@@ -511,11 +511,7 @@ pay_context_cleanup (void *cls)
   {
     struct DepositConfirmation *dc = &pc->dc[i];
 
-    if (NULL != dc->ub_sig.rsa_signature)
-    {
-      GNUNET_CRYPTO_rsa_signature_free (dc->ub_sig.rsa_signature);
-      dc->ub_sig.rsa_signature = NULL;
-    }
+    TALER_denom_sig_free (&dc->ub_sig);
     GNUNET_free (dc->exchange_url);
   }
   GNUNET_free (pc->dc);
@@ -590,7 +586,7 @@ deposit_cb (void *cls,
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Storing successful payment %s (%s) at instance `%s'\n",
                   pc->hc->infix,
-                  GNUNET_h2s (&pc->h_contract_terms),
+                  GNUNET_h2s (&pc->h_contract_terms.hash),
                   pc->hc->instance->settings.id);
       TMH_db->preflight (TMH_db->cls);
       {
@@ -846,6 +842,7 @@ process_pay_with_exchange (void *cls,
                                      pc->wire_transfer_deadline,
                                      pc->wm->j_wire,
                                      &pc->h_contract_terms,
+                                     NULL, /* FIXME-Oec */
                                      &dc->coin_pub,
                                      &dc->ub_sig,
                                      &denom_details->key,
@@ -1471,7 +1468,7 @@ execute_pay_transaction (struct PayContext *pc)
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Order `%s' (%s) was fully paid\n",
               pc->order_id,
-              GNUNET_h2s (&pc->h_contract_terms));
+              GNUNET_h2s (&pc->h_contract_terms.hash));
   {
     enum GNUNET_DB_QueryStatus qs;
 
@@ -1645,8 +1642,8 @@ parse_pay (struct MHD_Connection *connection,
                                        &dc->coin_sig),
           GNUNET_JSON_spec_fixed_auto ("coin_pub",
                                        &dc->coin_pub),
-          TALER_JSON_spec_denomination_signature ("ub_sig",
-                                                  &dc->ub_sig),
+          TALER_JSON_spec_denom_sig ("ub_sig",
+                                     &dc->ub_sig),
           GNUNET_JSON_spec_fixed_auto ("h_denom",
                                        &dc->h_denom),
           TALER_JSON_spec_amount ("contribution",
@@ -1758,7 +1755,7 @@ parse_pay (struct MHD_Connection *connection,
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Handling payment for order `%s' with contract hash `%s'\n",
                 pc->order_id,
-                GNUNET_h2s (&pc->h_contract_terms));
+                GNUNET_h2s (&pc->h_contract_terms.hash));
 
     /* basic sanity check on the contract */
     if (NULL == json_object_get (contract_terms,
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-refund.c 
b/src/backend/taler-merchant-httpd_post-orders-ID-refund.c
index ff64d9a2..8ba00129 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-refund.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-refund.c
@@ -134,7 +134,7 @@ struct PostRefundData
   /**
    * Hashed version of contract terms. All zeros if not provided.
    */
-  struct GNUNET_HashCode h_contract_terms;
+  struct TALER_PrivateContractHash h_contract_terms;
 
   /**
    * DLL of (suspended) requests.
@@ -620,7 +620,8 @@ TMH_post_orders_ID_refund (const struct TMH_RequestHandler 
*rh,
                                            hc->infix);
       }
       {
-        struct GNUNET_HashCode h_contract_terms;
+        struct TALER_PrivateContractHash h_contract_terms;
+
         if (GNUNET_OK !=
             TALER_JSON_contract_hash (contract_terms,
                                       &h_contract_terms))
diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c 
b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
index da4064d7..b018b282 100644
--- a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
+++ b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
@@ -71,7 +71,7 @@ struct ExchangeKycRequest
   /**
    * Hash of the wire account (with salt) we are checking.
    */
-  struct GNUNET_HashCode h_wire;
+  struct TALER_MerchantWireHash h_wire;
 
   /**
    * Handle for the actual HTTP request to the exchange.
@@ -179,7 +179,7 @@ struct KycContext
    * Set to the h_wire of the merchant account if
    * @a have_h_wire is true, used to filter by account.
    */
-  struct GNUNET_HashCode h_wire;
+  struct TALER_MerchantWireHash h_wire;
 
   /**
    * How long are we willing to wait for the exchange(s)?
@@ -523,12 +523,11 @@ kyc_with_exchange (void *cls,
 {
   struct ExchangeKycRequest *ekr = cls;
   struct KycContext *kc = ekr->kc;
-  struct GNUNET_HashCode h_payto;
+  struct TALER_PaytoHash h_payto;
 
   ekr->fo = NULL;
-  GNUNET_CRYPTO_hash (ekr->payto_uri,
-                      strlen (ekr->payto_uri),
-                      &h_payto);
+  TALER_payto_hash (ekr->payto_uri,
+                    &h_payto);
   ekr->kyc = TALER_EXCHANGE_kyc_check (eh,
                                        ekr->exchange_kyc_serial,
                                        &h_payto,
@@ -552,7 +551,7 @@ kyc_with_exchange (void *cls,
  */
 static void
 kyc_status_cb (void *cls,
-               const struct GNUNET_HashCode *h_wire,
+               const struct TALER_MerchantWireHash *h_wire,
                uint64_t exchange_kyc_serial,
                const char *payto_uri,
                const char *exchange_url,
diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c 
b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
index c2fe759f..ab4e379a 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -83,7 +83,7 @@ struct TransferQuery
   /**
    * Hash of the merchant's bank account the transfer (presumably) went to.
    */
-  struct GNUNET_HashCode h_wire;
+  struct TALER_MerchantWireHash h_wire;
 
   /**
    * Value deposited (including deposit fee).
@@ -200,7 +200,7 @@ struct GetOrderRequestContext
   /**
    * Hash over the @e contract_terms.
    */
-  struct GNUNET_HashCode h_contract_terms;
+  struct TALER_PrivateContractHash h_contract_terms;
 
   /**
    * Total amount the exchange deposited into our bank account
@@ -502,7 +502,7 @@ deposit_get_cb (void *cls,
          remember our target UUID */
       enum GNUNET_DB_QueryStatus qs;
       struct GNUNET_TIME_Absolute now;
-      struct GNUNET_HashCode h_wire;
+      struct TALER_MerchantWireHash h_wire;
 
       now = GNUNET_TIME_absolute_get ();
       (void) GNUNET_TIME_round_abs (&now);
@@ -658,7 +658,7 @@ static void
 deposit_cb (void *cls,
             uint64_t deposit_serial,
             const char *exchange_url,
-            const struct GNUNET_HashCode *h_wire,
+            const struct TALER_MerchantWireHash *h_wire,
             const struct TALER_Amount *amount_with_fee,
             const struct TALER_Amount *deposit_fee,
             const struct TALER_CoinSpendPublicKeyP *coin_pub)
@@ -1420,7 +1420,7 @@ TMH_private_get_orders_ID (const struct 
TMH_RequestHandler *rh,
     }
 
     {
-      struct GNUNET_HashCode *h_contract = NULL;
+      struct TALER_PrivateContractHash *h_contract = NULL;
 
       /* In a session-bound payment, allow the browser to check the order
        * status page (e.g. to get a refund).
diff --git a/src/backend/taler-merchant-httpd_private-get-orders.c 
b/src/backend/taler-merchant-httpd_private-get-orders.c
index ba8b47c9..8c6b12ff 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders.c
@@ -274,7 +274,7 @@ add_order (void *cls,
 {
   struct TMH_PendingOrder *po = cls;
   json_t *contract_terms;
-  struct GNUNET_HashCode h_contract_terms;
+  struct TALER_PrivateContractHash h_contract_terms;
   enum GNUNET_DB_QueryStatus qs;
   const char *summary;
   char *order_id = NULL;
diff --git a/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c 
b/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c
index ebbfdf0a..20645b30 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c
@@ -150,7 +150,7 @@ TMH_private_post_orders_ID_refund (const struct 
TMH_RequestHandler *rh,
     GNUNET_JSON_spec_end ()
   };
   enum TALER_MERCHANTDB_RefundStatus rs;
-  struct GNUNET_HashCode h_contract;
+  struct TALER_PrivateContractHash h_contract;
 
   {
     enum GNUNET_DB_QueryStatus qs;
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c 
b/src/backend/taler-merchant-httpd_private-post-orders.c
index 2706e511..e148bc0d 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -1046,7 +1046,7 @@ patch_order (struct MHD_Connection *connection,
 
   /* sanity check result */
   {
-    struct GNUNET_HashCode h_control;
+    struct TALER_PrivateContractHash h_control;
 
     switch (TALER_JSON_contract_hash (order,
                                       &h_control))
diff --git a/src/backend/taler-merchant-httpd_private-post-transfers.c 
b/src/backend/taler-merchant-httpd_private-post-transfers.c
index 2febf4bc..871aa57a 100644
--- a/src/backend/taler-merchant-httpd_private-post-transfers.c
+++ b/src/backend/taler-merchant-httpd_private-post-transfers.c
@@ -298,7 +298,7 @@ check_transfer (void *cls,
                 const struct TALER_Amount *deposit_fee,
                 const struct TALER_Amount *refund_fee,
                 const struct TALER_Amount *wire_fee,
-                const struct GNUNET_HashCode *h_wire,
+                const struct TALER_MerchantWireHash *h_wire,
                 struct GNUNET_TIME_Absolute deposit_timestamp,
                 struct GNUNET_TIME_Absolute refund_deadline,
                 const struct TALER_ExchangeSignatureP *exchange_sig,
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 4b90674e..ffd8fd71 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -838,7 +838,7 @@ struct KycStatusContext
   /**
    * Filter, NULL to not filter.
    */
-  const struct GNUNET_HashCode *h_wire;
+  const struct TALER_MerchantWireHash *h_wire;
 
   /**
    * Filter, NULL to not filter.
@@ -874,7 +874,7 @@ kyc_status_cb (void *cls,
 
   for (unsigned int i = 0; i < num_results; i++)
   {
-    struct GNUNET_HashCode h_wire;
+    struct TALER_MerchantWireHash h_wire;
     uint64_t kyc_serial;
     char *exchange_url;
     char *payto_uri;
@@ -948,7 +948,7 @@ kyc_status_cb (void *cls,
 static enum GNUNET_DB_QueryStatus
 postgres_account_kyc_get_status (void *cls,
                                  const char *merchant_id,
-                                 const struct GNUNET_HashCode *h_wire,
+                                 const struct TALER_MerchantWireHash *h_wire,
                                  const char *exchange_url,
                                  TALER_MERCHANTDB_KycCallback kyc_cb,
                                  void *kyc_cb_cls)
@@ -1001,7 +1001,7 @@ static enum GNUNET_DB_QueryStatus
 postgres_account_kyc_set_status (
   void *cls,
   const char *merchant_id,
-  const struct GNUNET_HashCode *h_wire,
+  const struct TALER_MerchantWireHash *h_wire,
   const char *exchange_url,
   uint64_t exchange_kyc_serial,
   const struct TALER_ExchangeSignatureP *exchange_sig,
@@ -1160,7 +1160,7 @@ postgres_update_instance_auth (
 static enum GNUNET_DB_QueryStatus
 postgres_inactivate_account (void *cls,
                              const char *merchant_id,
-                             const struct GNUNET_HashCode *h_wire)
+                             const struct TALER_MerchantWireHash *h_wire)
 {
   struct PostgresClosure *pg = cls;
   struct GNUNET_PQ_QueryParam params[] = {
@@ -1187,7 +1187,7 @@ postgres_inactivate_account (void *cls,
 static enum GNUNET_DB_QueryStatus
 postgres_activate_account (void *cls,
                            const char *merchant_id,
-                           const struct GNUNET_HashCode *h_wire)
+                           const struct TALER_MerchantWireHash *h_wire)
 {
   struct PostgresClosure *pg = cls;
   struct GNUNET_PQ_QueryParam params[] = {
@@ -2042,7 +2042,7 @@ postgres_insert_contract_terms (void *cls,
   struct GNUNET_TIME_Absolute pay_deadline;
   struct GNUNET_TIME_Absolute refund_deadline;
   const char *fulfillment_url;
-  struct GNUNET_HashCode h_contract_terms;
+  struct TALER_PrivateContractHash h_contract_terms;
 
   if (GNUNET_OK !=
       TALER_JSON_contract_hash (contract_terms,
@@ -2122,7 +2122,7 @@ postgres_update_contract_terms (void *cls,
   struct GNUNET_TIME_Absolute pay_deadline;
   struct GNUNET_TIME_Absolute refund_deadline;
   const char *fulfillment_url = NULL;
-  struct GNUNET_HashCode h_contract_terms;
+  struct TALER_PrivateContractHash h_contract_terms;
 
   if (GNUNET_OK !=
       TALER_JSON_contract_hash (contract_terms,
@@ -2316,7 +2316,8 @@ lookup_deposits_cb (void *cls,
 static enum GNUNET_DB_QueryStatus
 postgres_lookup_deposits (void *cls,
                           const char *instance_id,
-                          const struct GNUNET_HashCode *h_contract_terms,
+                          const struct
+                          TALER_PrivateContractHash *h_contract_terms,
                           TALER_MERCHANTDB_DepositsCallback cb,
                           void *cb_cls)
 {
@@ -2336,7 +2337,7 @@ postgres_lookup_deposits (void *cls,
   /* no preflight check here, run in its own transaction by the caller! */
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Finding deposits for h_contract_terms '%s'\n",
-              GNUNET_h2s (h_contract_terms));
+              GNUNET_h2s (&h_contract_terms->hash));
   check_connection (pg);
   qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
                                              "lookup_deposits",
@@ -2409,19 +2410,20 @@ postgres_insert_exchange_signkey (
  * @return transaction status
  */
 static enum GNUNET_DB_QueryStatus
-postgres_insert_deposit (void *cls,
-                         const char *instance_id,
-                         struct GNUNET_TIME_Absolute deposit_timestamp,
-                         const struct GNUNET_HashCode *h_contract_terms,
-                         const struct TALER_CoinSpendPublicKeyP *coin_pub,
-                         const char *exchange_url,
-                         const struct TALER_Amount *amount_with_fee,
-                         const struct TALER_Amount *deposit_fee,
-                         const struct TALER_Amount *refund_fee,
-                         const struct TALER_Amount *wire_fee,
-                         const struct GNUNET_HashCode *h_wire,
-                         const struct TALER_ExchangeSignatureP *exchange_sig,
-                         const struct TALER_ExchangePublicKeyP *exchange_pub)
+postgres_insert_deposit (
+  void *cls,
+  const char *instance_id,
+  struct GNUNET_TIME_Absolute deposit_timestamp,
+  const struct TALER_PrivateContractHash *h_contract_terms,
+  const struct TALER_CoinSpendPublicKeyP *coin_pub,
+  const char *exchange_url,
+  const struct TALER_Amount *amount_with_fee,
+  const struct TALER_Amount *deposit_fee,
+  const struct TALER_Amount *refund_fee,
+  const struct TALER_Amount *wire_fee,
+  const struct TALER_MerchantWireHash *h_wire,
+  const struct TALER_ExchangeSignatureP *exchange_sig,
+  const struct TALER_ExchangePublicKeyP *exchange_pub)
 {
   struct PostgresClosure *pg = cls;
   struct GNUNET_PQ_QueryParam params[] = {
@@ -2444,7 +2446,7 @@ postgres_insert_deposit (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Storing deposit for instance `%s' h_contract_terms `%s', 
coin_pub: `%s', amount_with_fee: %s\n",
               instance_id,
-              GNUNET_h2s (h_contract_terms),
+              GNUNET_h2s (&h_contract_terms->hash),
               TALER_B2S (coin_pub),
               TALER_amount2s (amount_with_fee));
   check_connection (pg);
@@ -2541,7 +2543,8 @@ lookup_refunds_cb (void *cls,
 static enum GNUNET_DB_QueryStatus
 postgres_lookup_refunds (void *cls,
                          const char *instance_id,
-                         const struct GNUNET_HashCode *h_contract_terms,
+                         const struct
+                         TALER_PrivateContractHash *h_contract_terms,
                          TALER_MERCHANTDB_RefundCallback rc,
                          void *rc_cls)
 {
@@ -2560,7 +2563,7 @@ postgres_lookup_refunds (void *cls,
 
   /* no preflight check here, run in transaction by caller! */
   TALER_LOG_DEBUG ("Looking for refund of h_contract_terms %s at `%s'\n",
-                   GNUNET_h2s (h_contract_terms),
+                   GNUNET_h2s (&h_contract_terms->hash),
                    instance_id);
   check_connection (pg);
   qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
@@ -2588,7 +2591,8 @@ postgres_lookup_refunds (void *cls,
 static enum GNUNET_DB_QueryStatus
 postgres_mark_contract_paid (void *cls,
                              const char *instance_id,
-                             const struct GNUNET_HashCode *h_contract_terms,
+                             const struct
+                             TALER_PrivateContractHash *h_contract_terms,
                              const char *session_id)
 {
   struct PostgresClosure *pg = cls;
@@ -2611,7 +2615,7 @@ postgres_mark_contract_paid (void *cls,
   /* no preflight check here, run in transaction by caller! */
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Marking h_contract_terms '%s' of %s as paid for session `%s'\n",
-              GNUNET_h2s (h_contract_terms),
+              GNUNET_h2s (&h_contract_terms->hash),
               instance_id,
               session_id);
   qs = GNUNET_PQ_eval_prepared_non_select (pg->conn,
@@ -2649,7 +2653,7 @@ postgres_mark_contract_paid (void *cls,
 static enum GNUNET_DB_QueryStatus
 postgres_refund_coin (void *cls,
                       const char *instance_id,
-                      const struct GNUNET_HashCode *h_contract_terms,
+                      const struct TALER_PrivateContractHash *h_contract_terms,
                       struct GNUNET_TIME_Absolute refund_timestamp,
                       const struct TALER_CoinSpendPublicKeyP *coin_pub,
                       const char *reason)
@@ -2684,7 +2688,7 @@ static enum GNUNET_DB_QueryStatus
 postgres_lookup_order_status (void *cls,
                               const char *instance_id,
                               const char *order_id,
-                              struct GNUNET_HashCode *h_contract_terms,
+                              struct TALER_PrivateContractHash 
*h_contract_terms,
                               bool *paid)
 {
   struct PostgresClosure *pg = cls;
@@ -2732,7 +2736,8 @@ postgres_lookup_order_status_by_serial (void *cls,
                                         const char *instance_id,
                                         uint64_t order_serial,
                                         char **order_id,
-                                        struct GNUNET_HashCode 
*h_contract_terms,
+                                        struct TALER_PrivateContractHash *
+                                        h_contract_terms,
                                         bool *paid)
 {
   struct PostgresClosure *pg = cls;
@@ -2882,7 +2887,7 @@ lookup_deposits_by_order_cb (void *cls,
   {
     uint64_t deposit_serial;
     char *exchange_url;
-    struct GNUNET_HashCode h_wire;
+    struct TALER_MerchantWireHash h_wire;
     struct TALER_CoinSpendPublicKeyP coin_pub;
     struct TALER_Amount amount_with_fee;
     struct TALER_Amount deposit_fee;
@@ -3708,7 +3713,7 @@ static enum GNUNET_DB_QueryStatus
 postgres_lookup_refunds_detailed (
   void *cls,
   const char *instance_id,
-  const struct GNUNET_HashCode *h_contract_terms,
+  const struct TALER_PrivateContractHash *h_contract_terms,
   TALER_MERCHANTDB_RefundDetailCallback rc,
   void *rc_cls)
 {
@@ -3727,7 +3732,7 @@ postgres_lookup_refunds_detailed (
 
   /* no preflight check here, run in transaction by caller! */
   TALER_LOG_DEBUG ("Looking for refund %s + %s\n",
-                   GNUNET_h2s (h_contract_terms),
+                   GNUNET_h2s (&h_contract_terms->hash),
                    instance_id);
   check_connection (pg);
   qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
@@ -4296,7 +4301,7 @@ lookup_deposits_by_contract_and_coin_cb (void *cls,
     struct TALER_Amount deposit_fee;
     struct TALER_Amount refund_fee;
     struct TALER_Amount wire_fee;
-    struct GNUNET_HashCode h_wire;
+    struct TALER_MerchantWireHash h_wire;
     struct GNUNET_TIME_Absolute deposit_timestamp;
     struct GNUNET_TIME_Absolute refund_deadline;
     struct TALER_ExchangeSignatureP exchange_sig;
@@ -4367,7 +4372,7 @@ static enum GNUNET_DB_QueryStatus
 postgres_lookup_deposits_by_contract_and_coin (
   void *cls,
   const char *instance_id,
-  const struct GNUNET_HashCode *h_contract_terms,
+  const struct TALER_PrivateContractHash *h_contract_terms,
   const struct TALER_CoinSpendPublicKeyP *coin_pub,
   TALER_MERCHANTDB_CoinDepositCallback cb,
   void *cb_cls)
diff --git a/src/include/taler_merchantdb_plugin.h 
b/src/include/taler_merchantdb_plugin.h
index 4ba2dade..929ad7af 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -41,7 +41,7 @@ struct TALER_MERCHANTDB_AccountDetails
   /**
    * Hash of the wire details (@e payto_uri and @e salt).
    */
-  struct GNUNET_HashCode h_wire;
+  struct TALER_MerchantWireHash h_wire;
 
   /**
    * Salt value used for hashing @e payto_uri.
@@ -396,7 +396,7 @@ typedef void
 typedef void
 (*TALER_MERCHANTDB_KycCallback)(
   void *cls,
-  const struct GNUNET_HashCode *h_wire,
+  const struct TALER_MerchantWireHash *h_wire,
   uint64_t exchange_kyc_serial,
   const char *payto_uri,
   const char *exchange_url,
@@ -582,7 +582,7 @@ typedef void
   void *cls,
   uint64_t deposit_serial,
   const char *exchange_url,
-  const struct GNUNET_HashCode *h_wire,
+  const struct TALER_MerchantWireHash *h_wire,
   const struct TALER_Amount *amount_with_fee,
   const struct TALER_Amount *deposit_fee,
   const struct TALER_CoinSpendPublicKeyP *coin_pub);
@@ -660,7 +660,7 @@ typedef void
   const struct TALER_Amount *deposit_fee,
   const struct TALER_Amount *refund_fee,
   const struct TALER_Amount *wire_fee,
-  const struct GNUNET_HashCode *h_wire,
+  const struct TALER_MerchantWireHash *h_wire,
   struct GNUNET_TIME_Absolute deposit_timestamp,
   struct GNUNET_TIME_Absolute refund_deadline,
   const struct TALER_ExchangeSignatureP *exchange_sig,
@@ -967,7 +967,7 @@ struct TALER_MERCHANTDB_Plugin
   enum GNUNET_DB_QueryStatus
   (*inactivate_account)(void *cls,
                         const char *merchant_id,
-                        const struct GNUNET_HashCode *h_wire);
+                        const struct TALER_MerchantWireHash *h_wire);
 
 
   /**
@@ -981,7 +981,7 @@ struct TALER_MERCHANTDB_Plugin
   enum GNUNET_DB_QueryStatus
   (*activate_account)(void *cls,
                       const char *merchant_id,
-                      const struct GNUNET_HashCode *h_wire);
+                      const struct TALER_MerchantWireHash *h_wire);
 
 
   /**
@@ -1000,7 +1000,7 @@ struct TALER_MERCHANTDB_Plugin
   enum GNUNET_DB_QueryStatus
   (*account_kyc_get_status)(void *cls,
                             const char *merchant_id,
-                            const struct GNUNET_HashCode *h_wire,
+                            const struct TALER_MerchantWireHash *h_wire,
                             const char *exchange_url,
                             TALER_MERCHANTDB_KycCallback kyc_cb,
                             void *kyc_cb_cls);
@@ -1022,7 +1022,7 @@ struct TALER_MERCHANTDB_Plugin
   enum GNUNET_DB_QueryStatus
   (*account_kyc_set_status)(void *cls,
                             const char *merchant_id,
-                            const struct GNUNET_HashCode *h_wire,
+                            const struct TALER_MerchantWireHash *h_wire,
                             const char *exchange_url,
                             uint64_t exchange_kyc_serial,
                             const struct TALER_ExchangeSignatureP 
*exchange_sig,
@@ -1379,7 +1379,7 @@ struct TALER_MERCHANTDB_Plugin
   enum GNUNET_DB_QueryStatus
   (*lookup_deposits)(void *cls,
                      const char *instance_id,
-                     const struct GNUNET_HashCode *h_contract_terms,
+                     const struct TALER_PrivateContractHash *h_contract_terms,
                      TALER_MERCHANTDB_DepositsCallback cb,
                      void *cb_cls);
 
@@ -1427,14 +1427,14 @@ struct TALER_MERCHANTDB_Plugin
   (*insert_deposit)(void *cls,
                     const char *instance_id,
                     struct GNUNET_TIME_Absolute deposit_timestamp,
-                    const struct GNUNET_HashCode *h_contract_terms,
+                    const struct TALER_PrivateContractHash *h_contract_terms,
                     const struct TALER_CoinSpendPublicKeyP *coin_pub,
                     const char *exchange_url,
                     const struct TALER_Amount *amount_with_fee,
                     const struct TALER_Amount *deposit_fee,
                     const struct TALER_Amount *refund_fee,
                     const struct TALER_Amount *wire_fee,
-                    const struct GNUNET_HashCode *h_wire,
+                    const struct TALER_MerchantWireHash *h_wire,
                     const struct TALER_ExchangeSignatureP *exchange_sig,
                     const struct TALER_ExchangePublicKeyP *exchange_pub);
 
@@ -1452,7 +1452,7 @@ struct TALER_MERCHANTDB_Plugin
   enum GNUNET_DB_QueryStatus
   (*lookup_refunds)(void *cls,
                     const char *instance_id,
-                    const struct GNUNET_HashCode *h_contract_terms,
+                    const struct TALER_PrivateContractHash *h_contract_terms,
                     TALER_MERCHANTDB_RefundCallback rc,
                     void *rc_cls);
 
@@ -1471,7 +1471,8 @@ struct TALER_MERCHANTDB_Plugin
   enum GNUNET_DB_QueryStatus
   (*mark_contract_paid)(void *cls,
                         const char *instance_id,
-                        const struct GNUNET_HashCode *h_contract_terms,
+                        const struct
+                        TALER_PrivateContractHash *h_contract_terms,
                         const char *session_id);
 
 
@@ -1493,7 +1494,7 @@ struct TALER_MERCHANTDB_Plugin
   enum GNUNET_DB_QueryStatus
   (*refund_coin)(void *cls,
                  const char *instance_id,
-                 const struct GNUNET_HashCode *h_contract_terms,
+                 const struct TALER_PrivateContractHash *h_contract_terms,
                  struct GNUNET_TIME_Absolute refund_timestamp,
                  const struct TALER_CoinSpendPublicKeyP *coin_pub,
                  const char *reason);
@@ -1513,7 +1514,7 @@ struct TALER_MERCHANTDB_Plugin
   (*lookup_order_status)(void *cls,
                          const char *instance_id,
                          const char *order_id,
-                         struct GNUNET_HashCode *h_contract_terms,
+                         struct TALER_PrivateContractHash *h_contract_terms,
                          bool *paid);
 
   /**
@@ -1532,7 +1533,8 @@ struct TALER_MERCHANTDB_Plugin
                                    const char *instance_id,
                                    uint64_t order_serial,
                                    char **order_id,
-                                   struct GNUNET_HashCode *h_contract_terms,
+                                   struct TALER_PrivateContractHash *
+                                   h_contract_terms,
                                    bool *paid);
 
 
@@ -1655,7 +1657,8 @@ struct TALER_MERCHANTDB_Plugin
   enum GNUNET_DB_QueryStatus
   (*lookup_refunds_detailed)(void *cls,
                              const char *instance_id,
-                             const struct GNUNET_HashCode *h_contract_terms,
+                             const struct
+                             TALER_PrivateContractHash *h_contract_terms,
                              TALER_MERCHANTDB_RefundDetailCallback rc,
                              void *rc_cls);
 
@@ -1849,7 +1852,7 @@ struct TALER_MERCHANTDB_Plugin
   (*lookup_deposits_by_contract_and_coin)(
     void *cls,
     const char *instance_id,
-    const struct GNUNET_HashCode *h_contract_terms,
+    const struct TALER_PrivateContractHash *h_contract_terms,
     const struct TALER_CoinSpendPublicKeyP *coin_pub,
     TALER_MERCHANTDB_CoinDepositCallback cb,
     void *cb_cls);

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