gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] 204/277: moved yna to exchange


From: gnunet
Subject: [taler-merchant] 204/277: moved yna to exchange
Date: Sun, 05 Jul 2020 20:51:57 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

commit 3f2b7316255c1a583c7720b3e7624ab16d4378b2
Author: Jonathan Buchanan <jonathan.russ.buchanan@gmail.com>
AuthorDate: Fri Jun 12 15:21:32 2020 -0400

    moved yna to exchange
---
 .../taler-merchant-httpd_private-get-orders.c      | 75 ++++++----------------
 .../taler-merchant-httpd_private-get-reserves.c    | 20 +++---
 .../taler-merchant-httpd_private-get-tips.c        | 51 ++-------------
 .../taler-merchant-httpd_private-get-transfers.c   | 10 +--
 src/backenddb/plugin_merchantdb_postgres.c         | 52 +++++++--------
 src/backenddb/test_merchantdb.c                    | 60 ++++++++---------
 src/include/taler_merchantdb_plugin.h              | 36 ++---------
 7 files changed, 101 insertions(+), 203 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-get-orders.c 
b/src/backend/taler-merchant-httpd_private-get-orders.c
index 669a2e3..d2f502f 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders.c
@@ -250,12 +250,12 @@ TMH_notify_order_change (const char *instance_id,
        po = pn)
   {
     pn = po->next;
-    if (! ( ( ((TALER_MERCHANTDB_YNA_YES == po->of.paid) == paid) ||
-              (TALER_MERCHANTDB_YNA_ALL == po->of.paid) ) &&
-            ( ((TALER_MERCHANTDB_YNA_YES == po->of.refunded) == refunded) ||
-              (TALER_MERCHANTDB_YNA_ALL == po->of.refunded) ) &&
-            ( ((TALER_MERCHANTDB_YNA_YES == po->of.wired) == wired) ||
-              (TALER_MERCHANTDB_YNA_ALL == po->of.wired) ) ) )
+    if (! ( ( ((TALER_EXCHANGE_YNA_YES == po->of.paid) == paid) ||
+              (TALER_EXCHANGE_YNA_ALL == po->of.paid) ) &&
+            ( ((TALER_EXCHANGE_YNA_YES == po->of.refunded) == refunded) ||
+              (TALER_EXCHANGE_YNA_ALL == po->of.refunded) ) &&
+            ( ((TALER_EXCHANGE_YNA_YES == po->of.wired) == wired) ||
+              (TALER_EXCHANGE_YNA_ALL == po->of.wired) ) ) )
       continue;
     if (0 != strcmp (instance_id,
                      po->instance_id))
@@ -294,48 +294,6 @@ TMH_notify_order_change (const char *instance_id,
 }
 
 
-/**
- * Convert query argument to @a yna value.
- *
- * @param connection connection to take query argument from
- * @param arg argument to try for
- * @param[out] value to set
- * @return true on success, false if the parameter was malformed
- */
-static bool
-arg_to_yna (struct MHD_Connection *connection,
-            const char *arg,
-            enum TALER_MERCHANTDB_YesNoAll *yna)
-{
-  const char *str;
-
-  str = MHD_lookup_connection_value (connection,
-                                     MHD_GET_ARGUMENT_KIND,
-                                     arg);
-  if (NULL == str)
-  {
-    *yna = TALER_MERCHANTDB_YNA_ALL;
-    return true;
-  }
-  if (0 == strcasecmp (str, "yes"))
-  {
-    *yna = TALER_MERCHANTDB_YNA_YES;
-    return true;
-  }
-  if (0 == strcasecmp (str, "no"))
-  {
-    *yna = TALER_MERCHANTDB_YNA_NO;
-    return true;
-  }
-  if (0 == strcasecmp (str, "all"))
-  {
-    *yna = TALER_MERCHANTDB_YNA_ALL;
-    return true;
-  }
-  return false;
-}
-
-
 /**
  * Handle a GET "/orders" request.
  *
@@ -363,23 +321,26 @@ TMH_private_get_orders (const struct TMH_RequestHandler 
*rh,
                                       "orders", hc->ctx);
   }
 
-  if (! (arg_to_yna (connection,
-                     "paid",
-                     &of.paid)) )
+  if (! (TALER_arg_to_yna (connection,
+                           "paid",
+                           TALER_EXCHANGE_YNA_ALL,
+                           &of.paid)) )
     return TALER_MHD_reply_with_error (connection,
                                        MHD_HTTP_BAD_REQUEST,
                                        TALER_EC_PARAMETER_MALFORMED,
                                        "paid");
-  if (! (arg_to_yna (connection,
-                     "refunded",
-                     &of.refunded)) )
+  if (! (TALER_arg_to_yna (connection,
+                           "refunded",
+                           TALER_EXCHANGE_YNA_ALL,
+                           &of.refunded)) )
     return TALER_MHD_reply_with_error (connection,
                                        MHD_HTTP_BAD_REQUEST,
                                        TALER_EC_PARAMETER_MALFORMED,
                                        "refunded");
-  if (! (arg_to_yna (connection,
-                     "wired",
-                     &of.wired)) )
+  if (! (TALER_arg_to_yna (connection,
+                           "wired",
+                           TALER_EXCHANGE_YNA_ALL,
+                           &of.wired)) )
     return TALER_MHD_reply_with_error (connection,
                                        MHD_HTTP_BAD_REQUEST,
                                        TALER_EC_PARAMETER_MALFORMED,
diff --git a/src/backend/taler-merchant-httpd_private-get-reserves.c 
b/src/backend/taler-merchant-httpd_private-get-reserves.c
index 780f88c..be607c0 100644
--- a/src/backend/taler-merchant-httpd_private-get-reserves.c
+++ b/src/backend/taler-merchant-httpd_private-get-reserves.c
@@ -93,8 +93,8 @@ TMH_private_get_reserves (const struct TMH_RequestHandler *rh,
   json_t *ra;
   enum GNUNET_DB_QueryStatus qs;
   struct GNUNET_TIME_Absolute created_after = { 0 };
-  enum TALER_MERCHANTDB_YesNoAll active;
-  enum TALER_MERCHANTDB_YesNoAll failures;
+  enum TALER_EXCHANGE_YesNoAll active;
+  enum TALER_EXCHANGE_YesNoAll failures;
 
   {
     const char *active_s;
@@ -104,22 +104,22 @@ TMH_private_get_reserves (const struct TMH_RequestHandler 
*rh,
                                             "active");
     if (NULL == active_s)
     {
-      active = TALER_MERCHANTDB_YNA_ALL;
+      active = TALER_EXCHANGE_YNA_ALL;
     }
     else if (0 == strcasecmp (active_s,
                               "yes"))
     {
-      active = TALER_MERCHANTDB_YNA_YES;
+      active = TALER_EXCHANGE_YNA_YES;
     }
     else if (0 == strcasecmp (active_s,
                               "no"))
     {
-      active = TALER_MERCHANTDB_YNA_NO;
+      active = TALER_EXCHANGE_YNA_NO;
     }
     else if (0 == strcasecmp (active_s,
                               "all"))
     {
-      active = TALER_MERCHANTDB_YNA_ALL;
+      active = TALER_EXCHANGE_YNA_ALL;
     }
     else
       return TALER_MHD_reply_with_error (connection,
@@ -136,22 +136,22 @@ TMH_private_get_reserves (const struct TMH_RequestHandler 
*rh,
                                               "failures");
     if (NULL == failures_s)
     {
-      failures = TALER_MERCHANTDB_YNA_ALL;
+      failures = TALER_EXCHANGE_YNA_ALL;
     }
     else if (0 == strcasecmp (failures_s,
                               "yes"))
     {
-      failures = TALER_MERCHANTDB_YNA_YES;
+      failures = TALER_EXCHANGE_YNA_YES;
     }
     else if (0 == strcasecmp (failures_s,
                               "no"))
     {
-      failures = TALER_MERCHANTDB_YNA_NO;
+      failures = TALER_EXCHANGE_YNA_NO;
     }
     else if (0 == strcasecmp (failures_s,
                               "all"))
     {
-      failures = TALER_MERCHANTDB_YNA_ALL;
+      failures = TALER_EXCHANGE_YNA_ALL;
     }
     else
       return TALER_MHD_reply_with_error (connection,
diff --git a/src/backend/taler-merchant-httpd_private-get-tips.c 
b/src/backend/taler-merchant-httpd_private-get-tips.c
index dc4beac..42651d0 100644
--- a/src/backend/taler-merchant-httpd_private-get-tips.c
+++ b/src/backend/taler-merchant-httpd_private-get-tips.c
@@ -52,48 +52,6 @@ add_tip (void *cls,
 }
 
 
-/**
- * Convert query argument to @a yna value.
- *
- * @param connection connection to take query argument from
- * @param arg argument to try for
- * @param[out] value to set
- * @return true on success, false if the parameter was malformed
- */
-static bool
-arg_to_yna (struct MHD_Connection *connection,
-            const char *arg,
-            enum TALER_MERCHANTDB_YesNoAll *yna)
-{
-  const char *str;
-
-  str = MHD_lookup_connection_value (connection,
-                                     MHD_GET_ARGUMENT_KIND,
-                                     arg);
-  if (NULL == str)
-  {
-    *yna = TALER_MERCHANTDB_YNA_NO;
-    return true;
-  }
-  if (0 == strcasecmp (str, "yes"))
-  {
-    *yna = TALER_MERCHANTDB_YNA_YES;
-    return true;
-  }
-  if (0 == strcasecmp (str, "no"))
-  {
-    *yna = TALER_MERCHANTDB_YNA_NO;
-    return true;
-  }
-  if (0 == strcasecmp (str, "all"))
-  {
-    *yna = TALER_MERCHANTDB_YNA_ALL;
-    return true;
-  }
-  return false;
-}
-
-
 /**
  * Handle a GET "/tips/$ID" request.
  *
@@ -109,7 +67,7 @@ TMH_private_get_tips (const struct TMH_RequestHandler *rh,
 {
   json_t *pa;
   enum GNUNET_DB_QueryStatus qs;
-  enum TALER_MERCHANTDB_YesNoAll expired;
+  enum TALER_EXCHANGE_YesNoAll expired;
   uint64_t offset;
   int64_t limit;
 
@@ -117,9 +75,10 @@ TMH_private_get_tips (const struct TMH_RequestHandler *rh,
   // - also change TALER_MERCHANTDB_YNA to TALER_EXCHANGE_YNA,
   // - code can go into src/util/ of exchange.git
   // - please look for other places where the same logic is duplicated to 
de-dup
-  if (! (arg_to_yna (connection, /* TODO: put this method in a header 
somewhere */
-                     "expired",
-                     &expired)) )
+  if (! (TALER_arg_to_yna (connection, /* TODO: put this method in a header 
somewhere */
+                           "expired",
+                           TALER_EXCHANGE_YNA_NO,
+                           &expired)) )
     return TALER_MHD_reply_with_error (connection,
                                        MHD_HTTP_BAD_REQUEST,
                                        TALER_EC_PARAMETER_MALFORMED,
diff --git a/src/backend/taler-merchant-httpd_private-get-transfers.c 
b/src/backend/taler-merchant-httpd_private-get-transfers.c
index 0bf53f3..c2f1210 100644
--- a/src/backend/taler-merchant-httpd_private-get-transfers.c
+++ b/src/backend/taler-merchant-httpd_private-get-transfers.c
@@ -95,7 +95,7 @@ TMH_private_get_transfers (const struct TMH_RequestHandler 
*rh,
   struct GNUNET_TIME_Absolute after = GNUNET_TIME_UNIT_ZERO_ABS;
   int64_t limit = -20; /* FIXME: default? Nothing documented!!? */
   uint64_t offset;
-  enum TALER_MERCHANTDB_YesNoAll verified;
+  enum TALER_EXCHANGE_YesNoAll verified;
 
   payto_uri = MHD_lookup_connection_value (connection,
                                            MHD_GET_ARGUMENT_KIND,
@@ -191,22 +191,22 @@ TMH_private_get_transfers (const struct 
TMH_RequestHandler *rh,
                                               "verified");
     if (NULL == verified_s)
     {
-      verified = TALER_MERCHANTDB_YNA_ALL;
+      verified = TALER_EXCHANGE_YNA_ALL;
     }
     else if (0 == strcasecmp (verified_s,
                               "yes"))
     {
-      verified = TALER_MERCHANTDB_YNA_YES;
+      verified = TALER_EXCHANGE_YNA_YES;
     }
     else if (0 == strcasecmp (verified_s,
                               "no"))
     {
-      verified = TALER_MERCHANTDB_YNA_NO;
+      verified = TALER_EXCHANGE_YNA_NO;
     }
     else if (0 == strcasecmp (verified_s,
                               "all"))
     {
-      verified = TALER_MERCHANTDB_YNA_ALL;
+      verified = TALER_EXCHANGE_YNA_ALL;
     }
     else
       return TALER_MHD_reply_with_error (connection,
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 827874d..ac18044 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -1224,9 +1224,9 @@ postgres_lookup_orders (void *cls,
   enum GNUNET_DB_QueryStatus qs;
   char stmt[128];
 
-  paid = (TALER_MERCHANTDB_YNA_YES == of->paid);
-  refunded = (TALER_MERCHANTDB_YNA_YES == of->refunded);
-  wired = (TALER_MERCHANTDB_YNA_YES == of->wired);
+  paid = (TALER_EXCHANGE_YNA_YES == of->paid);
+  refunded = (TALER_EXCHANGE_YNA_YES == of->refunded);
+  wired = (TALER_EXCHANGE_YNA_YES == of->wired);
   /* painfully many cases..., note that "_xxx" being present in 'stmt' merely
      means that we filter by that variable, the value we filter for is
      computed above */
@@ -1234,10 +1234,10 @@ postgres_lookup_orders (void *cls,
                    sizeof (stmt),
                    "lookup_orders_%s%s%s%s",
                    (of->delta > 0) ? "inc" : "dec",
-                   (TALER_MERCHANTDB_YNA_ALL == of->paid) ? "" : "_paid",
-                   (TALER_MERCHANTDB_YNA_ALL == of->refunded) ? "" :
+                   (TALER_EXCHANGE_YNA_ALL == of->paid) ? "" : "_paid",
+                   (TALER_EXCHANGE_YNA_ALL == of->refunded) ? "" :
                    "_refunded",
-                   (TALER_MERCHANTDB_YNA_ALL == of->wired) ? "" : "_wired");
+                   (TALER_EXCHANGE_YNA_ALL == of->wired) ? "" : "_wired");
   qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
                                              stmt,
                                              params,
@@ -3858,7 +3858,7 @@ struct LookupTransfersContext
   /**
    * Filter to apply by verification status.
    */
-  enum TALER_MERCHANTDB_YesNoAll verified;
+  enum TALER_EXCHANGE_YesNoAll verified;
 };
 
 
@@ -3886,7 +3886,7 @@ lookup_transfers_cb (void *cls,
     char *exchange_url;
     uint64_t transfer_serial_id;
     struct GNUNET_TIME_Absolute execution_time;
-    enum TALER_MERCHANTDB_YesNoAll verified;
+    enum TALER_EXCHANGE_YesNoAll verified;
     uint8_t verified8;
     uint8_t confirmed8;
     struct GNUNET_PQ_ResultSpec rs[] = {
@@ -3919,10 +3919,10 @@ lookup_transfers_cb (void *cls,
       return;
     }
     if (0 == verified8)
-      verified = TALER_MERCHANTDB_YNA_NO;
+      verified = TALER_EXCHANGE_YNA_NO;
     else
-      verified = TALER_MERCHANTDB_YNA_YES;
-    if ( (ltc->verified == TALER_MERCHANTDB_YNA_ALL) ||
+      verified = TALER_EXCHANGE_YNA_YES;
+    if ( (ltc->verified == TALER_EXCHANGE_YNA_ALL) ||
          (ltc->verified == verified) )
     {
       ltc->qs = i + 1;
@@ -3933,7 +3933,7 @@ lookup_transfers_cb (void *cls,
                exchange_url,
                transfer_serial_id,
                execution_time,
-               TALER_MERCHANTDB_YNA_YES == verified,
+               TALER_EXCHANGE_YNA_YES == verified,
                0 != confirmed8);
     }
     GNUNET_PQ_cleanup_result (rs);
@@ -3969,7 +3969,7 @@ postgres_lookup_transfers (void *cls,
                            struct GNUNET_TIME_Absolute after,
                            int64_t limit,
                            uint64_t offset,
-                           enum TALER_MERCHANTDB_YesNoAll verified,
+                           enum TALER_EXCHANGE_YesNoAll verified,
                            TALER_MERCHANTDB_TransferCallback cb,
                            void *cb_cls)
 {
@@ -4246,13 +4246,13 @@ struct LookupReservesContext
   /**
    * Filter by active reserves.
    */
-  enum TALER_MERCHANTDB_YesNoAll active;
+  enum TALER_EXCHANGE_YesNoAll active;
 
   /**
    * Filter by failures (missmatch in exchange claimed and
    * merchant claimed initial amounts).
    */
-  enum TALER_MERCHANTDB_YesNoAll failures;
+  enum TALER_EXCHANGE_YesNoAll failures;
 
   /**
    * Set in case of errors.
@@ -4319,28 +4319,28 @@ lookup_reserves_cb (void *cls,
     }
     switch (lrc->active)
     {
-    case TALER_MERCHANTDB_YNA_YES:
+    case TALER_EXCHANGE_YNA_YES:
       if (! active)
         continue;
-    case TALER_MERCHANTDB_YNA_NO:
+    case TALER_EXCHANGE_YNA_NO:
       if (active)
         continue;
-    case TALER_MERCHANTDB_YNA_ALL:
+    case TALER_EXCHANGE_YNA_ALL:
       break;
     }
     switch (lrc->failures)
     {
-    case TALER_MERCHANTDB_YNA_YES:
+    case TALER_EXCHANGE_YNA_YES:
       if (0 ==
           TALER_amount_cmp (&merchant_initial_balance,
                             &exchange_initial_balance))
         continue;
-    case TALER_MERCHANTDB_YNA_NO:
+    case TALER_EXCHANGE_YNA_NO:
       if (0 !=
           TALER_amount_cmp (&merchant_initial_balance,
                             &exchange_initial_balance))
         continue;
-    case TALER_MERCHANTDB_YNA_ALL:
+    case TALER_EXCHANGE_YNA_ALL:
       break;
     }
     lrc->cb (lrc->cb_cls,
@@ -4372,8 +4372,8 @@ static enum GNUNET_DB_QueryStatus
 postgres_lookup_reserves (void *cls,
                           const char *instance_id,
                           struct GNUNET_TIME_Absolute created_after,
-                          enum TALER_MERCHANTDB_YesNoAll active,
-                          enum TALER_MERCHANTDB_YesNoAll failures,
+                          enum TALER_EXCHANGE_YesNoAll active,
+                          enum TALER_EXCHANGE_YesNoAll failures,
                           TALER_MERCHANTDB_ReservesCallback cb,
                           void *cb_cls)
 {
@@ -5246,7 +5246,7 @@ lookup_tips_cb (void *cls,
 static enum GNUNET_DB_QueryStatus
 postgres_lookup_tips (void *cls,
                       const char *instance_id,
-                      enum TALER_MERCHANTDB_YesNoAll expired,
+                      enum TALER_EXCHANGE_YesNoAll expired,
                       int64_t limit,
                       uint64_t offset,
                       TALER_MERCHANTDB_TipsCallback cb,
@@ -5272,12 +5272,12 @@ postgres_lookup_tips (void *cls,
   enum GNUNET_DB_QueryStatus qs;
   char stmt[128];
 
-  bexpired = (TALER_MERCHANTDB_YNA_YES == expired);
+  bexpired = (TALER_EXCHANGE_YNA_YES == expired);
   GNUNET_snprintf (stmt,
                    sizeof (stmt),
                    "lookup_tips_%s%s",
                    (limit > 0) ? "inc" : "dec",
-                   (TALER_MERCHANTDB_YNA_ALL == expired) ? "" : "_expired");
+                   (TALER_EXCHANGE_YNA_ALL == expired) ? "" : "_expired");
   qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
                                              stmt,
                                              params,
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
index 658c4c6..43208e8 100644
--- a/src/backenddb/test_merchantdb.c
+++ b/src/backenddb/test_merchantdb.c
@@ -1320,9 +1320,9 @@ static int
 run_test_orders (struct TestOrders_Closure *cls)
 {
   struct TALER_MERCHANTDB_OrderFilter filter = {
-    .paid = TALER_MERCHANTDB_YNA_ALL,
-    .refunded = TALER_MERCHANTDB_YNA_ALL,
-    .wired = TALER_MERCHANTDB_YNA_ALL,
+    .paid = TALER_EXCHANGE_YNA_ALL,
+    .refunded = TALER_EXCHANGE_YNA_ALL,
+    .wired = TALER_EXCHANGE_YNA_ALL,
     .date = GNUNET_TIME_absolute_get_zero_ (),
     .start_row = 0,
     .delta = 8
@@ -1434,7 +1434,7 @@ run_test_orders (struct TestOrders_Closure *cls)
   TEST_RET_ON_FAIL (test_lookup_order_status (&cls->instance,
                                               &cls->orders[0],
                                               true));
-  filter.paid = TALER_MERCHANTDB_YNA_YES;
+  filter.paid = TALER_EXCHANGE_YNA_YES;
   TEST_RET_ON_FAIL (test_lookup_orders (&cls->instance,
                                         &filter,
                                         1,
@@ -2381,7 +2381,7 @@ test_lookup_transfers (const char *instance_id,
                        struct GNUNET_TIME_Absolute after,
                        int64_t limit,
                        uint64_t offset,
-                       enum TALER_MERCHANTDB_YesNoAll filter_verified,
+                       enum TALER_EXCHANGE_YesNoAll filter_verified,
                        unsigned int transfers_length,
                        const struct TransferWithDetails *transfers)
 {
@@ -2649,7 +2649,7 @@ run_test_transfers (struct TestTransfers_Closure *cls)
                                            GNUNET_TIME_UNIT_ZERO_ABS,
                                            1,
                                            0,
-                                           TALER_MERCHANTDB_YNA_ALL,
+                                           TALER_EXCHANGE_YNA_ALL,
                                            1,
                                            &full_transfer_data));
 
@@ -2876,8 +2876,8 @@ test_lookup_reserves (const char *instance_id,
   if (1 != plugin->lookup_reserves (plugin->cls,
                                     instance_id,
                                     GNUNET_TIME_absolute_get_zero_ (),
-                                    TALER_MERCHANTDB_YNA_ALL,
-                                    TALER_MERCHANTDB_YNA_ALL,
+                                    TALER_EXCHANGE_YNA_ALL,
+                                    TALER_EXCHANGE_YNA_ALL,
                                     &lookup_reserves_cb,
                                     &cmp))
   {
@@ -3221,7 +3221,7 @@ lookup_tips_cb (void *cls,
 
 static int
 test_lookup_tips (const struct InstanceData *instance,
-                  enum TALER_MERCHANTDB_YesNoAll expired,
+                  enum TALER_EXCHANGE_YesNoAll expired,
                   int64_t limit,
                   uint64_t offset,
                   unsigned int tips_length,
@@ -3449,7 +3449,7 @@ run_test_tips (struct TestTips_Closure *cls)
                          "Authorize tip failed\n");
   /* Test lookup tips */
   TEST_RET_ON_FAIL (test_lookup_tips (&cls->instance,
-                                      TALER_MERCHANTDB_YNA_ALL,
+                                      TALER_EXCHANGE_YNA_ALL,
                                       1,
                                       0,
                                       1,
@@ -3493,7 +3493,7 @@ run_test_tips (struct TestTips_Closure *cls)
                    sizeof (struct TipData) * 5);
     /* Test lookup tips inc */
     TEST_RET_ON_FAIL (test_lookup_tips (&cls->instance,
-                                        TALER_MERCHANTDB_YNA_ALL,
+                                        TALER_EXCHANGE_YNA_ALL,
                                         6,
                                         0,
                                         6,
@@ -3502,7 +3502,7 @@ run_test_tips (struct TestTips_Closure *cls)
                             expected_tips);
     /* Test lookup tips dec */
     TEST_RET_ON_FAIL (test_lookup_tips (&cls->instance,
-                                        TALER_MERCHANTDB_YNA_ALL,
+                                        TALER_EXCHANGE_YNA_ALL,
                                         -6,
                                         10,
                                         6,
@@ -3512,7 +3512,7 @@ run_test_tips (struct TestTips_Closure *cls)
     expected_tips[1] = cls->tips[2];
     expected_tips[2] = cls->tips[4];
     TEST_RET_ON_FAIL (test_lookup_tips (&cls->instance,
-                                        TALER_MERCHANTDB_YNA_YES,
+                                        TALER_EXCHANGE_YNA_YES,
                                         6,
                                         0,
                                         3,
@@ -3521,7 +3521,7 @@ run_test_tips (struct TestTips_Closure *cls)
     reverse_tip_data_array (3,
                             expected_tips);
     TEST_RET_ON_FAIL (test_lookup_tips (&cls->instance,
-                                        TALER_MERCHANTDB_YNA_YES,
+                                        TALER_EXCHANGE_YNA_YES,
                                         -6,
                                         10,
                                         3,
@@ -3531,7 +3531,7 @@ run_test_tips (struct TestTips_Closure *cls)
     expected_tips[1] = cls->tips[1];
     expected_tips[2] = cls->tips[3];
     TEST_RET_ON_FAIL (test_lookup_tips (&cls->instance,
-                                        TALER_MERCHANTDB_YNA_NO,
+                                        TALER_EXCHANGE_YNA_NO,
                                         6,
                                         0,
                                         3,
@@ -3540,7 +3540,7 @@ run_test_tips (struct TestTips_Closure *cls)
     reverse_tip_data_array (3,
                             expected_tips);
     TEST_RET_ON_FAIL (test_lookup_tips (&cls->instance,
-                                        TALER_MERCHANTDB_YNA_NO,
+                                        TALER_EXCHANGE_YNA_NO,
                                         -6,
                                         10,
                                         3,
@@ -4134,17 +4134,17 @@ run_test_lookup_orders_all_filters (struct
   /* Order filter extravaganza */
   struct OrderData expected_orders[16];
   struct TALER_MERCHANTDB_OrderFilter filter_inc = {
-    .paid = TALER_MERCHANTDB_YNA_ALL,
-    .refunded = TALER_MERCHANTDB_YNA_ALL,
-    .wired = TALER_MERCHANTDB_YNA_ALL,
+    .paid = TALER_EXCHANGE_YNA_ALL,
+    .refunded = TALER_EXCHANGE_YNA_ALL,
+    .wired = TALER_EXCHANGE_YNA_ALL,
     .date = GNUNET_TIME_absolute_get_zero_ (),
     .start_row = 0,
     .delta = 16
   };
   struct TALER_MERCHANTDB_OrderFilter filter_dec = {
-    .paid = TALER_MERCHANTDB_YNA_ALL,
-    .refunded = TALER_MERCHANTDB_YNA_ALL,
-    .wired = TALER_MERCHANTDB_YNA_ALL,
+    .paid = TALER_EXCHANGE_YNA_ALL,
+    .refunded = TALER_EXCHANGE_YNA_ALL,
+    .wired = TALER_EXCHANGE_YNA_ALL,
     .date = GNUNET_TIME_UNIT_FOREVER_ABS,
     .start_row = 23, /* Why does this need to be 20 and not 18? */
     .delta = -16
@@ -4205,7 +4205,7 @@ run_test_lookup_orders_all_filters (struct
                                         16,
                                         expected_orders));
   /* lookup_orders_inc_paid */
-  filter_inc.paid = TALER_MERCHANTDB_YNA_YES;
+  filter_inc.paid = TALER_EXCHANGE_YNA_YES;
   for (unsigned int i = 0; i < 8; ++i)
     expected_orders[i] = cls->orders[2 * i];
   TEST_RET_ON_FAIL (test_lookup_orders (&cls->instance,
@@ -4213,7 +4213,7 @@ run_test_lookup_orders_all_filters (struct
                                         8,
                                         expected_orders));
   /* lookup_orders_dec_paid */
-  filter_dec.paid = TALER_MERCHANTDB_YNA_YES;
+  filter_dec.paid = TALER_EXCHANGE_YNA_YES;
   reverse_order_data_array (8,
                             expected_orders);
   TEST_RET_ON_FAIL (test_lookup_orders (&cls->instance,
@@ -4221,8 +4221,8 @@ run_test_lookup_orders_all_filters (struct
                                         8,
                                         expected_orders));
   /* lookup_orders_inc_refunded */
-  filter_inc.paid = TALER_MERCHANTDB_YNA_ALL;
-  filter_inc.refunded = TALER_MERCHANTDB_YNA_YES;
+  filter_inc.paid = TALER_EXCHANGE_YNA_ALL;
+  filter_inc.refunded = TALER_EXCHANGE_YNA_YES;
   unsigned int indices[] = {
     0, 1, 4, 8, 12
   };
@@ -4235,8 +4235,8 @@ run_test_lookup_orders_all_filters (struct
                                         5,
                                         expected_orders));
   /* lookup_orders_dec_refunded */
-  filter_dec.paid = TALER_MERCHANTDB_YNA_ALL;
-  filter_dec.refunded = TALER_MERCHANTDB_YNA_YES;
+  filter_dec.paid = TALER_EXCHANGE_YNA_ALL;
+  filter_dec.refunded = TALER_EXCHANGE_YNA_YES;
   reverse_order_data_array (5,
                             expected_orders);
   TEST_RET_ON_FAIL (test_lookup_orders (&cls->instance,
@@ -4246,7 +4246,7 @@ run_test_lookup_orders_all_filters (struct
   /* lookup_orders_inc_wired */
   /* lookup_orders_dec_wired */
   /* lookup_orders_inc_paid_refunded */
-  filter_inc.paid = TALER_MERCHANTDB_YNA_YES;
+  filter_inc.paid = TALER_EXCHANGE_YNA_YES;
   for (unsigned int i = 0; i < 4; ++i)
     expected_orders[i] = cls->orders[4 * i];
   TEST_RET_ON_FAIL (test_lookup_orders (&cls->instance,
@@ -4254,7 +4254,7 @@ run_test_lookup_orders_all_filters (struct
                                         4,
                                         expected_orders));
   /* lookup_orders_dec_paid_refunded */
-  filter_dec.paid = TALER_MERCHANTDB_YNA_YES;
+  filter_dec.paid = TALER_EXCHANGE_YNA_YES;
   reverse_order_data_array (4,
                             expected_orders);
   TEST_RET_ON_FAIL (test_lookup_orders (&cls->instance,
diff --git a/src/include/taler_merchantdb_plugin.h 
b/src/include/taler_merchantdb_plugin.h
index 2fb231d..2f79674 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -219,28 +219,6 @@ struct TALER_MERCHANTDB_ProductDetails
 };
 
 
-/**
- * Possible values for a binary filter.
- */
-enum TALER_MERCHANTDB_YesNoAll
-{
-  /**
-   * If condition is yes.
-   */
-  TALER_MERCHANTDB_YNA_YES = 1,
-
-  /**
-  * If condition is no.
-  */
-  TALER_MERCHANTDB_YNA_NO = 2,
-
-  /**
-   * Condition disabled.
-   */
-  TALER_MERCHANTDB_YNA_ALL = 3
-};
-
-
 /**
  * Filter preferences.
  */
@@ -249,17 +227,17 @@ struct TALER_MERCHANTDB_OrderFilter
   /**
    * Filter by payment status.
    */
-  enum TALER_MERCHANTDB_YesNoAll paid;
+  enum TALER_EXCHANGE_YesNoAll paid;
 
   /**
    * Filter by refund status.
    */
-  enum TALER_MERCHANTDB_YesNoAll refunded;
+  enum TALER_EXCHANGE_YesNoAll refunded;
 
   /**
    * Filter by wire transfer status.
    */
-  enum TALER_MERCHANTDB_YesNoAll wired;
+  enum TALER_EXCHANGE_YesNoAll wired;
 
   /**
    * Filter orders by date, exact meaning depends on @e delta.
@@ -1626,7 +1604,7 @@ struct TALER_MERCHANTDB_Plugin
                       struct GNUNET_TIME_Absolute after,
                       int64_t limit,
                       uint64_t offset,
-                      enum TALER_MERCHANTDB_YesNoAll yna,
+                      enum TALER_EXCHANGE_YesNoAll yna,
                       TALER_MERCHANTDB_TransferCallback cb,
                       void *cb_cls);
 
@@ -1721,8 +1699,8 @@ struct TALER_MERCHANTDB_Plugin
   (*lookup_reserves)(void *cls,
                      const char *instance_id,
                      struct GNUNET_TIME_Absolute created_after,
-                     enum TALER_MERCHANTDB_YesNoAll active,
-                     enum TALER_MERCHANTDB_YesNoAll failures,
+                     enum TALER_EXCHANGE_YesNoAll active,
+                     enum TALER_EXCHANGE_YesNoAll failures,
                      TALER_MERCHANTDB_ReservesCallback cb,
                      void *cb_cls);
 
@@ -1875,7 +1853,7 @@ struct TALER_MERCHANTDB_Plugin
   enum GNUNET_DB_QueryStatus
   (*lookup_tips)(void *cls,
                  const char *instance_id,
-                 enum TALER_MERCHANTDB_YesNoAll expired,
+                 enum TALER_EXCHANGE_YesNoAll expired,
                  int64_t limit,
                  uint64_t offset,
                  TALER_MERCHANTDB_TipsCallback 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]