gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 111/130: -fixes for test


From: gnunet
Subject: [taler-exchange] 111/130: -fixes for test
Date: Wed, 17 Nov 2021 12:25:59 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

commit 77bab625607514a628dfda101e55c7d57f6b623d
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Nov 9 22:52:01 2021 +0100

    -fixes for test
---
 contrib/gana                                  |  2 +-
 src/curl/curl.c                               |  5 +----
 src/exchange/taler-exchange-httpd_kyc-check.c | 30 ++++++++++++++++++++++++---
 src/lib/exchange_api_kyc_wallet.c             |  9 ++++----
 src/testing/test_kyc_api.c                    |  2 --
 src/testing/testing_api_cmd_kyc_wallet_get.c  |  4 ++--
 6 files changed, 36 insertions(+), 16 deletions(-)

diff --git a/contrib/gana b/contrib/gana
index 8c7d9be4..fbd2bf1c 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit 8c7d9be40ba627348da3e01b91b4f1d3cc78631f
+Subproject commit fbd2bf1c8a39ff334b2ae52d7be44416490848bd
diff --git a/src/curl/curl.c b/src/curl/curl.c
index e9a2d561..424c41fd 100644
--- a/src/curl/curl.c
+++ b/src/curl/curl.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  Copyright (C) 2019-2020 Taler Systems SA
+  Copyright (C) 2019-2021 Taler Systems SA
 
   TALER is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published
@@ -24,9 +24,6 @@
 #include "platform.h"
 #include "taler_curl_lib.h"
 
-// FIXME-workaround: without this, we somehow sometimes forget the header
-// that indicates compression and then the exchange 400s us!
-#undef TALER_CURL_COMPRESS_BODIES
 
 #if TALER_CURL_COMPRESS_BODIES
 #include <zlib.h>
diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c 
b/src/exchange/taler-exchange-httpd_kyc-check.c
index 5964da50..79e85ca0 100644
--- a/src/exchange/taler-exchange-httpd_kyc-check.c
+++ b/src/exchange/taler-exchange-httpd_kyc-check.c
@@ -119,7 +119,31 @@ TEH_handler_kyc_check (
                                        TALER_EC_GENERIC_PARAMETER_MALFORMED,
                                        "payment_target_uuid");
   }
-  /* FIXME: write long polling logic ... */
+  {
+    const char *ts;
+
+    ts = MHD_lookup_connection_value (rc->connection,
+                                      MHD_GET_ARGUMENT_KIND,
+                                      "timeout_ms");
+    if (NULL != ts)
+    {
+      unsigned long long tms;
+
+      if (1 !=
+          sscanf (ts,
+                  "%llu%c",
+                  &tms,
+                  &dummy))
+      {
+        GNUNET_break_op (0);
+        return TALER_MHD_reply_with_error (rc->connection,
+                                           MHD_HTTP_BAD_REQUEST,
+                                           
TALER_EC_GENERIC_PARAMETER_MALFORMED,
+                                           "timeout_ms");
+      }
+      /* FIXME: write long polling logic ... */
+    }
+  }
   {
     const char *hps;
 
@@ -176,8 +200,8 @@ TEH_handler_kyc_check (
     {
       GNUNET_break_op (0);
       return TALER_MHD_reply_with_error (rc->connection,
-                                         MHD_HTTP_FORBIDDEN,
-                                         42, /* FIXME: EC! */
+                                         MHD_HTTP_UNAUTHORIZED,
+                                         
TALER_EC_EXCHANGE_KYC_CHECK_AUTHORIZATION_FAILED,
                                          "h_payto");
     }
     if (! kcc.kyc.ok)
diff --git a/src/lib/exchange_api_kyc_wallet.c 
b/src/lib/exchange_api_kyc_wallet.c
index e919b562..4a41fd59 100644
--- a/src/lib/exchange_api_kyc_wallet.c
+++ b/src/lib/exchange_api_kyc_wallet.c
@@ -209,10 +209,11 @@ TALER_EXCHANGE_kyc_wallet (struct TALER_EXCHANGE_Handle 
*exchange,
     return NULL;
   }
   json_decref (req);
-  kwh->job = GNUNET_CURL_job_add (ctx,
-                                  eh,
-                                  &handle_kyc_wallet_finished,
-                                  kwh);
+  kwh->job = GNUNET_CURL_job_add2 (ctx,
+                                   eh,
+                                   kwh->ctx.headers,
+                                   &handle_kyc_wallet_finished,
+                                   kwh);
   return kwh;
 }
 
diff --git a/src/testing/test_kyc_api.c b/src/testing/test_kyc_api.c
index 48464e2f..f90932b0 100644
--- a/src/testing/test_kyc_api.c
+++ b/src/testing/test_kyc_api.c
@@ -226,10 +226,8 @@ run (void *cls,
                              track),
     TALER_TESTING_cmd_batch ("withdraw-kyc",
                              withdraw_kyc),
-#if 0
     TALER_TESTING_cmd_batch ("wallet-kyc",
                              wallet_kyc),
-#endif
     TALER_TESTING_cmd_end ()
   };
 
diff --git a/src/testing/testing_api_cmd_kyc_wallet_get.c 
b/src/testing/testing_api_cmd_kyc_wallet_get.c
index e487f628..91ad09ff 100644
--- a/src/testing/testing_api_cmd_kyc_wallet_get.c
+++ b/src/testing/testing_api_cmd_kyc_wallet_get.c
@@ -167,11 +167,11 @@ wallet_kyc_run (void *cls,
   {
     GNUNET_CRYPTO_eddsa_key_create (&kwg->reserve_priv.eddsa_priv);
   }
+  GNUNET_CRYPTO_eddsa_key_get_public (&kwg->reserve_priv.eddsa_priv,
+                                      &kwg->reserve_pub.eddsa_pub);
   kwg->reserve_payto_uri
     = TALER_payto_from_reserve (TALER_EXCHANGE_get_base_url (is->exchange),
                                 &kwg->reserve_pub);
-  GNUNET_CRYPTO_eddsa_key_get_public (&kwg->reserve_priv.eddsa_priv,
-                                      &kwg->reserve_pub.eddsa_pub);
   kwg->kwh = TALER_EXCHANGE_kyc_wallet (is->exchange,
                                         &kwg->reserve_priv,
                                         &wallet_kyc_cb,

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