gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 01/02: activated tests for conflict wrt denom and age c


From: gnunet
Subject: [taler-exchange] 01/02: activated tests for conflict wrt denom and age commitment
Date: Sat, 23 Dec 2023 23:36:17 +0100

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

oec pushed a commit to branch master
in repository exchange.

commit 13bb37b6a811451accc14b3501173637f2c28d10
Author: Özgür Kesim <oec-taler@kesim.org>
AuthorDate: Sat Dec 23 14:56:12 2023 +0100

    activated tests for conflict wrt denom and age commitment
    
    In src/testing/test_exchange_api_conflicts.c we test the conflicts when
    two or more coins with the same private key have either different
    denominations or different age restrictions.
    
    Note that the test for different denominations does not fully work for
    CS:  Even with the same master secret, the private keys also differ due
    to the random choice of the nonce.
    
    Fixes #7276
---
 src/testing/Makefile.am                   |  1 +
 src/testing/test_exchange_api_conflicts.c | 28 +++++++++++++++++++++++-----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index 03118d77..ae713ab6 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -155,6 +155,7 @@ check_PROGRAMS = \
   test_exchange_api_rsa \
   test_exchange_api_age_restriction_cs \
   test_exchange_api_age_restriction_rsa \
+  test_exchange_api_conflicts_cs \
   test_exchange_api_conflicts_rsa \
   test_exchange_api_keys_cherry_picking_cs \
   test_exchange_api_keys_cherry_picking_rsa \
diff --git a/src/testing/test_exchange_api_conflicts.c 
b/src/testing/test_exchange_api_conflicts.c
index d26c2faf..070809d9 100644
--- a/src/testing/test_exchange_api_conflicts.c
+++ b/src/testing/test_exchange_api_conflicts.c
@@ -109,9 +109,9 @@ run (void *cls,
      * Move money to the exchange's bank account.
      */
     CMD_TRANSFER_TO_EXCHANGE ("create-reserve-denom",
-                              "EUR:21.03"),
+                              "EUR:21.14"),
     TALER_TESTING_cmd_check_bank_admin_transfer ("check-create-reserve-denom",
-                                                 "EUR:21.03",
+                                                 "EUR:21.14",
                                                  cred.user42_payto,
                                                  cred.exchange_payto,
                                                  "create-reserve-denom"),
@@ -121,7 +121,7 @@ run (void *cls,
      */
     CMD_EXEC_WIREWATCH ("wirewatch-conflict-denom"),
     /**
-     * Withdraw EUR:1, EUR:5, EUR:15, but using the same private key each time.
+     * Withdraw EUR:0.10, EUR:1, EUR:5, EUR:15, but using the same private key 
each time.
      */
     TALER_TESTING_cmd_batch_withdraw_with_conflict ("withdraw-coin-denom-1",
                                                     "create-reserve-denom",
@@ -131,6 +131,7 @@ run (void *cls,
                                                     "EUR:1",
                                                     "EUR:5",
                                                     "EUR:10",
+                                                    "EUR:0.10",
                                                     NULL),
 
     TALER_TESTING_cmd_end ()
@@ -155,7 +156,10 @@ run (void *cls,
                                "{\"items\":[{\"name\":\"ice 
cream\",\"value\":1}]}",
                                GNUNET_TIME_UNIT_ZERO,
                                "EUR:4.99",
-                               MHD_HTTP_CONFLICT),
+                               /* Note: For CS, even though the master secret 
is the
+                                * same for each coin, their private keys 
differ due
+                                * to the random choice of the nonce by the 
exchange. */
+                               uses_cs ? MHD_HTTP_OK : MHD_HTTP_CONFLICT),
     TALER_TESTING_cmd_deposit ("deposit-denom-conflict-2",
                                "withdraw-coin-denom-1",
                                2,
@@ -163,7 +167,21 @@ run (void *cls,
                                "{\"items\":[{\"name\":\"ice 
cream\",\"value\":1}]}",
                                GNUNET_TIME_UNIT_ZERO,
                                "EUR:9.99",
-                               MHD_HTTP_CONFLICT),
+                               /* Note: For CS, even though the master secret 
is the
+                                * same for each coin, their private keys 
differ due
+                                * to the random choice of the nonce by the 
exchange. */
+                               uses_cs ? MHD_HTTP_OK : MHD_HTTP_CONFLICT),
+    TALER_TESTING_cmd_deposit ("deposit-denom-conflict-3",
+                               "withdraw-coin-denom-1",
+                               3,
+                               cred.user42_payto,
+                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":1}]}",
+                               GNUNET_TIME_UNIT_ZERO,
+                               "EUR:0.09",
+                               /* Note: For CS, even though the master secret 
is the
+                                * same for each coin, their private keys 
differ due
+                                * to the random choice of the nonce by the 
exchange. */
+                               uses_cs ? MHD_HTTP_OK : MHD_HTTP_CONFLICT),
     TALER_TESTING_cmd_end ()
   };
 

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