gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: finish porting aggregator tests


From: gnunet
Subject: [taler-exchange] branch master updated: finish porting aggregator tests
Date: Thu, 16 Jan 2020 20:39:04 +0100

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

marcello pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new c20f6828 finish porting aggregator tests
c20f6828 is described below

commit c20f6828ae746ba48d01a3a2bdc6327b36e56ae4
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Jan 16 20:38:46 2020 +0100

    finish porting aggregator tests
---
 src/lib/test_taler_exchange_aggregator.c | 166 +++++++++++++++++++++++++++++++
 1 file changed, 166 insertions(+)

diff --git a/src/lib/test_taler_exchange_aggregator.c 
b/src/lib/test_taler_exchange_aggregator.c
index 15fb71a9..824d511e 100644
--- a/src/lib/test_taler_exchange_aggregator.c
+++ b/src/lib/test_taler_exchange_aggregator.c
@@ -1153,7 +1153,173 @@ run (void *cls,
 
 
     // Test profiteering if wire deadline is short
+    
+    TALER_TESTING_cmd_insert_deposit ("do-deposit-7a",
+                                     &dbc,
+                                     "bob",
+                                     USER42_ACCOUNT,
+                                     GNUNET_TIME_UNIT_ZERO,
+                                     "EUR:0.109",
+                                     "EUR:0.1"),
+
+    TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-7a-tiny",
+                                      config_filename),
+
+    TALER_TESTING_cmd_check_bank_empty 
("expect-empty-transactions-after-7a-tiny"),
+
+    TALER_TESTING_cmd_insert_deposit ("do-deposit-7b",
+                                     &dbc,
+                                     "bob",
+                                     USER42_ACCOUNT,
+                                     GNUNET_TIME_UNIT_ZERO,
+                                     "EUR:0.119",
+                                     "EUR:0.1"),
+
+    TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-7-profit",
+                                      config_filename),
+
+    TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-7",
+                                          ec.exchange_url,
+                                          "EUR:0.01",
+                                          bc.exchange_payto,
+                                          bc.user42_payto),
+
+    // Now check profit was actually taken
+
+
+    TALER_TESTING_cmd_insert_deposit ("do-deposit-7c",
+                                     &dbc,
+                                     "bob",
+                                     USER42_ACCOUNT,
+                                     GNUNET_TIME_UNIT_ZERO,
+                                     "EUR:0.122",
+                                     "EUR:0.1"),
+
+    TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-7-loss",
+                                      config_filename),
+
+    TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-7",
+                                          ec.exchange_url,
+                                          "EUR:0.01",
+                                          bc.exchange_payto,
+                                          bc.user42_payto),
+
+    // Test that aggregation would happen fully if wire deadline is long
+
+    TALER_TESTING_cmd_insert_deposit ("do-deposit-8a",
+                                     &dbc,
+                                     "bob",
+                                     USER42_ACCOUNT,
+
+                                     GNUNET_TIME_relative_multiply
+                                       (GNUNET_TIME_UNIT_SECONDS,
+                                        5),
+
+                                     "EUR:0.109",
+                                     "EUR:0.1"),
+
+    TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-8a-tiny",
+                                      config_filename),
+
+    TALER_TESTING_cmd_check_bank_empty 
("expect-empty-transactions-after-8a-tiny"),
+
+    TALER_TESTING_cmd_insert_deposit ("do-deposit-8b",
+                                     &dbc,
+                                     "bob",
+                                     USER42_ACCOUNT,
+
+                                     GNUNET_TIME_relative_multiply
+                                       (GNUNET_TIME_UNIT_SECONDS,
+                                        5),
+
+                                     "EUR:0.109",
+                                     "EUR:0.1"),
+
+    TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-8b-tiny",
+                                      config_filename),
 
+    TALER_TESTING_cmd_check_bank_empty 
("expect-empty-transactions-after-8b-tiny"),
+
+
+    // now trigger aggregate with large transaction and short deadline
+
+    TALER_TESTING_cmd_insert_deposit ("do-deposit-8c",
+                                     &dbc,
+                                     "bob",
+                                     USER42_ACCOUNT,
+                                     GNUNET_TIME_UNIT_ZERO,
+                                     "EUR:0.122",
+                                     "EUR:0.1"),
+
+    TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-8",
+                                      config_filename),
+
+    TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-8",
+                                          ec.exchange_url,
+                                          "EUR:0.03",
+                                          bc.exchange_payto,
+                                          bc.user42_payto),
+
+
+    // Test aggregation with fees and rounding profits.
+    
+    TALER_TESTING_cmd_insert_deposit ("do-deposit-9a",
+                                     &dbc,
+                                     "bob",
+                                     USER42_ACCOUNT,
+
+                                     GNUNET_TIME_relative_multiply
+                                       (GNUNET_TIME_UNIT_SECONDS,
+                                        5),
+
+                                     "EUR:0.104",
+                                     "EUR:0.1"),
+
+    TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-9a-tiny",
+                                      config_filename),
+
+    TALER_TESTING_cmd_check_bank_empty 
("expect-empty-transactions-after-9a-tiny"),
+
+    TALER_TESTING_cmd_insert_deposit ("do-deposit-9b",
+                                     &dbc,
+                                     "bob",
+                                     USER42_ACCOUNT,
+
+                                     GNUNET_TIME_relative_multiply
+                                       (GNUNET_TIME_UNIT_SECONDS,
+                                        5),
+
+                                     "EUR:0.105",
+                                     "EUR:0.1"),
+
+
+    TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-9b-tiny",
+                                      config_filename),
+    TALER_TESTING_cmd_check_bank_empty 
("expect-empty-transactions-after-9b-tiny"),
+
+
+
+
+    // now trigger aggregate with large transaction and short deadline
+
+    TALER_TESTING_cmd_insert_deposit ("do-deposit-9c",
+                                     &dbc,
+                                     "bob",
+                                     USER42_ACCOUNT,
+                                     GNUNET_TIME_UNIT_ZERO,
+                                     "EUR:0.112",
+                                     "EUR:0.1"),
+
+    TALER_TESTING_cmd_exec_aggregator ("run-aggregator-deposit-9",
+                                      config_filename),
+
+    // 0.009 + 0.009 + 0.022 - 0.001 - 0.002 - 0.008 = 0.029 => 0.02
+
+    TALER_TESTING_cmd_check_bank_transfer ("expect-deposit-9",
+                                          ec.exchange_url,
+                                          "EUR:0.01",
+                                          bc.exchange_payto,
+                                          bc.user42_payto),
     TALER_TESTING_cmd_end () 
   };
   

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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