gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -add safety checks against cmd t


From: gnunet
Subject: [taler-exchange] branch master updated: -add safety checks against cmd type confusion
Date: Tue, 05 Jul 2022 13:19:14 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 43662fbb -add safety checks against cmd type confusion
43662fbb is described below

commit 43662fbb6a1d1dc3184f69891d7cf68fca0837e7
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jul 5 13:19:04 2022 +0200

    -add safety checks against cmd type confusion
---
 src/testing/testing_api_cmd_refresh.c | 46 +++++++++++++++++------------------
 1 file changed, 22 insertions(+), 24 deletions(-)

diff --git a/src/testing/testing_api_cmd_refresh.c 
b/src/testing/testing_api_cmd_refresh.c
index bc0c4e09..2aad77ce 100644
--- a/src/testing/testing_api_cmd_refresh.c
+++ b/src/testing/testing_api_cmd_refresh.c
@@ -459,6 +459,19 @@ reveal_cb (void *cls,
 }
 
 
+/**
+ * Run the command.
+ *
+ * @param cls closure.
+ * @param cmd the command to execute.
+ * @param is the interpreter state.
+ */
+static void
+melt_run (void *cls,
+          const struct TALER_TESTING_Command *cmd,
+          struct TALER_TESTING_Interpreter *is);
+
+
 /**
  * Run the command.
  *
@@ -484,7 +497,7 @@ refresh_reveal_run (void *cls,
     TALER_TESTING_interpreter_fail (rrs->is);
     return;
   }
-  // FIXME: use trait for 'rms'!
+  GNUNET_assert (melt_cmd->run == &melt_run);
   rms = melt_cmd->cls;
   {
     struct TALER_ExchangeWithdrawValues alg_values[rms->num_fresh_coins];
@@ -791,17 +804,15 @@ refresh_link_run (void *cls,
   }
 
   /* find reserve_withdraw command */
+  GNUNET_assert (melt_cmd->run == &melt_run);
+  rms = melt_cmd->cls;
+  coin_cmd = TALER_TESTING_interpreter_lookup_command (rls->is,
+                                                       rms->coin_reference);
+  if (NULL == coin_cmd)
   {
-    // FIXME: use trait!
-    rms = melt_cmd->cls;
-    coin_cmd = TALER_TESTING_interpreter_lookup_command (rls->is,
-                                                         rms->coin_reference);
-    if (NULL == coin_cmd)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (rls->is);
-      return;
-    }
+    GNUNET_break (0);
+    TALER_TESTING_interpreter_fail (rls->is);
+    return;
   }
 
   const struct TALER_CoinSpendPrivateKeyP *coin_priv;
@@ -863,19 +874,6 @@ refresh_link_cleanup (void *cls,
 }
 
 
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command to execute.
- * @param is the interpreter state.
- */
-static void
-melt_run (void *cls,
-          const struct TALER_TESTING_Command *cmd,
-          struct TALER_TESTING_Interpreter *is);
-
-
 /**
  * Task scheduled to re-try #melt_run.
  *

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