gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated (dbf6e12 -> 8ef954e)


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated (dbf6e12 -> 8ef954e)
Date: Fri, 25 May 2018 14:36:12 +0200

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

marcello pushed a change to branch master
in repository exchange.

    from dbf6e12  aesthetic change.
     new afb4fb5  Commenting the "check keys" CMD.
     new 8ef954e  Commenting "payback" and "revoke" CMDs.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../test_exchange_api_keys_cherry_picking_new.c    | 11 +---
 src/exchange-lib/testing_api_cmd_check_keys.c      | 30 ++++++---
 src/exchange-lib/testing_api_cmd_payback.c         | 73 ++++++++++++----------
 3 files changed, 64 insertions(+), 50 deletions(-)

diff --git a/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c 
b/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c
index aa71143..9c5fe9a 100644
--- a/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c
+++ b/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c
@@ -64,7 +64,7 @@ run (void *cls,
 {
   struct TALER_TESTING_Command commands[] = {
 
-    /* Send signal to the exchange to see if it reacts */
+    /* Trigger keys reloading from disk.  */
     TALER_TESTING_cmd_signal ("signal-reaction-1",
                               is->exchanged,
                               SIGUSR1),
@@ -73,7 +73,8 @@ run (void *cls,
                                   1, 4,
                                   is->exchange),
 
-    TALER_TESTING_cmd_exec_keyup ("keyup-2", /* 1st keyup happens at start-up 
*/
+    /* 1st keyup happens at start-up */
+    TALER_TESTING_cmd_exec_keyup ("keyup-2", 
                                   CONFIG_FILE_EXTENDED),
 
     TALER_TESTING_cmd_exec_auditor_sign ("sign-keys-1",
@@ -91,12 +92,6 @@ run (void *cls,
                                   8,
 #endif
                                   is->exchange),
-
-
-    /**
-     * End the suite.  Fixme: better to have a label for this
-     * too, as it shows "(null)" in logs.
-     */
     TALER_TESTING_cmd_end ()
   };
 
diff --git a/src/exchange-lib/testing_api_cmd_check_keys.c 
b/src/exchange-lib/testing_api_cmd_check_keys.c
index b14740e..56b062a 100644
--- a/src/exchange-lib/testing_api_cmd_check_keys.c
+++ b/src/exchange-lib/testing_api_cmd_check_keys.c
@@ -29,15 +29,21 @@
 #include "exchange_api_handle.h"
 #include "taler_testing_lib.h"
 
+
+/**
+ * State for a "check keys" CMD.
+ */
 struct CheckKeysState
 {
   /**
-   * FIXME
+   * How many times the /keys response was received by the
+   * exchange under test.
    */
   unsigned int generation;
 
   /**
-   * FIXME
+   * How many denomination keys the exchange is supposed to
+   * have.
    */
   unsigned int num_denom_keys;
 
@@ -50,10 +56,10 @@ struct CheckKeysState
 
 
 /**
- * Run the command.
+ * Run the "check keys" command.
  *
- * @param cls closure, typically a #struct SignalState.
- * @param cmd the command to execute, a /wire one.
+ * @param cls closure.
+ * @param cmd the command currently being executed.
  * @param is the interpreter state.
  */
 static void
@@ -107,7 +113,7 @@ check_keys_run (void *cls,
 /**
  * Cleanup the state.
  *
- * @param cls closure, typically a #struct SignalState.
+ * @param cls closure.
  * @param cmd the command which is being cleaned up.
  */
 static void
@@ -121,11 +127,15 @@ check_keys_cleanup (void *cls,
 
 
 /**
- * Make a "check keys" command.
+ * Make a "check keys" command.  This type of command
+ * checks whether the number of denomination keys from
+ * @a exchange matches @a num_denom_keys.
  *
  * @param label command label
- * @param generation FIXME
- * @param num_denom_keys FIXME
+ * @param generation how many /keys responses are expected to
+ *        have been returned when this CMD will be run.
+ * @param num_denom_keys expected number of denomination keys.
+ * @param exchange connection handle to the exchange to test.
  *
  * @return the command.
  */
@@ -149,3 +159,5 @@ TALER_TESTING_cmd_check_keys
   cmd.cleanup = &check_keys_cleanup;
   return cmd;
 }
+
+/* end of testing_api_cmd_check_keys.c */
diff --git a/src/exchange-lib/testing_api_cmd_payback.c 
b/src/exchange-lib/testing_api_cmd_payback.c
index 65665c9..c60ac1d 100644
--- a/src/exchange-lib/testing_api_cmd_payback.c
+++ b/src/exchange-lib/testing_api_cmd_payback.c
@@ -29,6 +29,10 @@
 #include "exchange_api_handle.h"
 #include "taler_testing_lib.h"
 
+
+/**
+ * State for a "revoke" CMD.
+ */
 struct RevokeState
 {
   /**
@@ -52,7 +56,7 @@ struct RevokeState
   struct GNUNET_OS_Process *revoke_proc;
 
   /**
-   * Configuration filename.
+   * Configuration file name.
    */
   const char *config_filename;
 
@@ -63,6 +67,10 @@ struct RevokeState
 
 };
 
+
+/**
+ * State for a "pay back" CMD.
+ */
 struct PaybackState
 {
   /**
@@ -71,8 +79,8 @@ struct PaybackState
   unsigned int expected_response_code;
 
   /**
-   * Command that offers a reserve private key plus a
-   * coin to be paid back.
+   * Command that offers a reserve private key,
+   * plus a coin to be paid back.
    */
   const char *coin_reference;
 
@@ -95,24 +103,22 @@ struct PaybackState
    * Handle to the ongoing operation.
    */
   struct TALER_EXCHANGE_PaybackHandle *ph;
-
 };
 
 /**
- * Check the result of the payback request.
+ * Check the result of the payback request: checks whether
+ * the HTTP response code is good, and that the coin that
+ * was paid back belonged to the right reserve.
  *
  * @param cls closure
- * @param http_status HTTP response code, #MHD_HTTP_OK (200) for
- *        successful status request; 0 if the exchange's reply is
- *        bogus (fails to follow the protocol)
- * @param ec taler-specific error code, #TALER_EC_NONE on success
- * @param amount amount the exchange will wire back for this coin
+ * @param http_status HTTP response code.
+ * @param ec taler-specific error code.
+ * @param amount amount the exchange will wire back for this coin.
  * @param timestamp what time did the exchange receive the
  *        /payback request
- * @param reserve_pub public key of the reserve receiving the
- *        payback
- * @param full_response full response from the exchange (for
- *        logging, in case of errors)
+ * @param reserve_pub public key of the reserve affected by the
+ *        payback.
+ * @param full_response raw response from the exchange.
  */
 static void
 payback_cb (void *cls,
@@ -205,8 +211,8 @@ payback_cb (void *cls,
 /**
  * Run the command.
  *
- * @param cls closure, typically a #struct WireState.
- * @param cmd the command to execute, a /wire one.
+ * @param cls closure.
+ * @param cmd the command to execute.
  * @param is the interpreter state.
  */
 static void
@@ -310,9 +316,10 @@ revoke_cleanup (void *cls,
 
 
 /**
- * Cleanup the state.
+ * Cleanup the "payback" CMD state, and possibly cancel
+ * a pending operation thereof.
  *
- * @param cls closure, typically a #struct WireState.
+ * @param cls closure.
  * @param cmd the command which is being cleaned up.
  */
 static void
@@ -330,8 +337,7 @@ payback_cleanup (void *cls,
 
 
 /**
- * Extract information from a command that is useful for other
- * commands.
+ * Offer internal data from a "revoke" CMD to other CMDs.
  *
  * @param cls closure
  * @param ret[out] result (could be anything)
@@ -364,10 +370,12 @@ revoke_traits (void *cls,
 }
 
 /**
- * Run the command.
+ * Run the "revoke" command.  The core of the function
+ * is to call the "keyup" utility passing it the base32
+ * encoding of the denomination to revoke.
  *
- * @param cls closure, typically a #struct WireState.
- * @param cmd the command to execute, a /wire one.
+ * @param cls closure.
+ * @param cmd the command to execute.
  * @param is the interpreter state.
  */
 static void
@@ -411,7 +419,6 @@ revoke_run (void *cls,
      "-r", rs->dhks,
      NULL);
 
-
   if (NULL == rs->revoke_proc)
   {
     GNUNET_break (0);
@@ -427,15 +434,15 @@ revoke_run (void *cls,
 
 
 /**
- * Make a /payback command.
+ * Make a "payback" command.
  *
  * @param label the command label
  * @param expected_response_code expected HTTP status code
  * @param coin_reference reference to any command which
- *        offers a reserve private key
+ *        offers a coin & reserve private key.
  * @param amount denomination to pay back.
  *
- * @return a /revoke command
+ * @return the command.
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_payback (const char *label,
@@ -461,15 +468,15 @@ TALER_TESTING_cmd_payback (const char *label,
 
 
 /**
- * Make a /revoke command.
+ * Make a "revoke" command.
  *
- * @param label the command label
- * @param expected_response_code expected HTTP status code
- * @param coin_reference reference to any command which offers
- *        a coin trait
+ * @param label the command label.
+ * @param expected_response_code expected HTTP status code.
+ * @param coin_reference reference to a CMD that will offer the
+ *        denomination to revoke.
  * @param config_filename configuration file name.
  *
- * @return a /revoke command
+ * @return the command.
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_revoke (const char *label,

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



reply via email to

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