gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated: reject non increasi


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: reject non increasing amounts
Date: Thu, 22 Jun 2017 14:58:06 +0200

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

marcello pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 7612d3c  reject non increasing amounts
7612d3c is described below

commit 7612d3c0d5c5855088705bcc76142877f5ba6bc1
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Jun 22 14:58:00 2017 +0200

    reject non increasing amounts
---
 src/backend/taler-merchant-httpd_refund.c  | 2 +-
 src/backenddb/plugin_merchantdb_postgres.c | 4 ++--
 src/backenddb/test_merchantdb.c            | 8 ++++++++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_refund.c 
b/src/backend/taler-merchant-httpd_refund.c
index 2f0853a..a753f07 100644
--- a/src/backend/taler-merchant-httpd_refund.c
+++ b/src/backend/taler-merchant-httpd_refund.c
@@ -484,7 +484,7 @@ MH_handler_refund_lookup (struct TMH_RequestHandler *rh,
     /*This is very odd, as the unhashed version *was* found earlier*/
     return TMH_RESPONSE_reply_not_found (connection,
                                          
TALER_EC_REFUND_H_CONTRACT_TERMS_UNKNOWN,
-                                         "h_contract_terms not found in 
database");
+                                         "h_contract_terms not found among 
granted refunds");
   }
 
   if (GNUNET_SYSERR == res)
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 5716a62..89d7904 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -2084,8 +2084,8 @@ process_deposits_cb (void *cls,
   /**
    * Check if the refund is bigger than the previous awarded.
    */
-  if (-1 == TALER_amount_cmp (&attempted_refund,
-                              &previous_refund))
+  if (2 != (1 + TALER_amount_cmp (&attempted_refund,
+                                  &previous_refund)))
   {
 
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
index 975b3b4..c90691d 100644
--- a/src/backenddb/test_merchantdb.c
+++ b/src/backenddb/test_merchantdb.c
@@ -576,6 +576,14 @@ run (void *cls)
                                                 &refund_amount,
                                                 "refund testing"));
 
+  FAILIF (GNUNET_NO !=
+          plugin->increase_refund_for_contract (plugin->cls,
+                                                &h_contract_terms,
+                                                &merchant_pub,
+                                                &refund_amount,
+                                                "same refund amount as "
+                                                "the previous one, should 
fail"));
+
   /*Should fail as this refund a lesser amount respect to the previous one*/
   FAILIF (GNUNET_NO !=
           plugin->increase_refund_for_contract (plugin->cls,

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



reply via email to

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