gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: add missing traits


From: gnunet
Subject: [taler-anastasis] branch master updated: add missing traits
Date: Sat, 13 Feb 2021 13:45:36 +0100

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

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 97ada37  add missing traits
97ada37 is described below

commit 97ada376de6767ed9328dc2e7faf288aab554a7d
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Feb 13 13:45:34 2021 +0100

    add missing traits
---
 src/testing/Makefile.am                            |  4 +-
 src/testing/testing_api_trait_eks.c                | 58 ++++++++++++++++++++++
 src/testing/testing_api_trait_payment_identifier.c | 35 ++++---------
 ...tifier.c => testing_api_trait_payment_secret.c} | 20 ++++----
 ..._identifier.c => testing_api_trait_truth_key.c} | 39 +++++----------
 5 files changed, 93 insertions(+), 63 deletions(-)

diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index 6e6c2c9..5fcfebe 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -21,7 +21,9 @@ libanastasistesting_la_SOURCES = \
   testing_api_helpers.c \
   testing_api_trait_account_pub.c \
   testing_api_trait_account_priv.c \
-  testing_api_trait_payment_identifier.c \
+  testing_api_trait_eks.c \
+  testing_api_trait_payment_secret.c \
+  testing_api_trait_truth_key.c \
   testing_api_trait_truth_uuid.c \
   testing_api_trait_hash.c \
   testing_api_trait_salt.c \
diff --git a/src/testing/testing_api_trait_eks.c 
b/src/testing/testing_api_trait_eks.c
new file mode 100644
index 0000000..dc3f923
--- /dev/null
+++ b/src/testing/testing_api_trait_eks.c
@@ -0,0 +1,58 @@
+/*
+  This file is part of TALER
+  Copyright (C) 2021 Taler Systems SA
+
+  TALER is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published
+  by the Free Software Foundation; either version 3, or (at your
+  option) any later version.
+
+  TALER is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public
+  License along with TALER; see the file COPYING.  If not, see
+  <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file lib/testing_api_trait_eks.c
+ * @brief traits to offer a payment identifier
+ * @author Dennis Neufeld
+ */
+#include "platform.h"
+#include "anastasis_testing_lib.h"
+
+#define ANASTASIS_TESTING_TRAIT_EKS \
+  "anastasis-eks"
+
+
+int
+ANASTASIS_TESTING_get_trait_eks
+  (const struct TALER_TESTING_Command *cmd,
+  unsigned int index,
+  const struct ANASTASIS_CRYPTO_EncryptedKeyShareP **eks)
+{
+  return cmd->traits (cmd->cls,
+                      (const void **) eks,
+                      ANASTASIS_TESTING_TRAIT_EKS,
+                      index);
+}
+
+
+struct TALER_TESTING_Trait
+ANASTASIS_TESTING_make_trait_eks
+  (unsigned int index,
+  const struct ANASTASIS_CRYPTO_EncryptedKeyShareP *eks)
+{
+  struct TALER_TESTING_Trait ret = {
+    .index = index,
+    .trait_name = ANASTASIS_TESTING_TRAIT_EKS,
+    .ptr = (const void *) eks
+  };
+  return ret;
+}
+
+
+/* end of testing_api_trait_eks.c */
diff --git a/src/testing/testing_api_trait_payment_identifier.c 
b/src/testing/testing_api_trait_payment_identifier.c
index e27568a..6824f87 100644
--- a/src/testing/testing_api_trait_payment_identifier.c
+++ b/src/testing/testing_api_trait_payment_identifier.c
@@ -17,57 +17,42 @@
   <http://www.gnu.org/licenses/>
 */
 /**
- * @file lib/testing_api_trait_payment_identifier.c
+ * @file lib/testing_api_trait_payment_secret.c
  * @brief traits to offer a payment identifier
  * @author Dennis Neufeld
  */
 #include "platform.h"
 #include "anastasis_testing_lib.h"
 
-#define ANASTASIS_TESTING_TRAIT_PAYMENT_IDENTIFIER \
-  "anastasis-payment_identifier"
+#define ANASTASIS_TESTING_TRAIT_PAYMENT_SECRET \
+  "anastasis-payment_secret"
 
 
-/**
- * Obtain an account public key from @a cmd.
- *
- * @param cmd command to extract the payment identifier from.
- * @param index the payment identifier's index number.
- * @param n[out] set to the payment identifier coming from @a cmd.
- * @return #GNUNET_OK on success.
- */
 int
-ANASTASIS_TESTING_get_trait_payment_identifier
+ANASTASIS_TESTING_get_trait_payment_secret
   (const struct TALER_TESTING_Command *cmd,
   unsigned int index,
-  const struct ANASTASIS_PaymentSecretP **payment_identifier)
+  const struct ANASTASIS_PaymentSecretP **payment_secret)
 {
   return cmd->traits (cmd->cls,
-                      (const void **) payment_identifier,
-                      ANASTASIS_TESTING_TRAIT_PAYMENT_IDENTIFIER,
+                      (const void **) payment_secret,
+                      ANASTASIS_TESTING_TRAIT_PAYMENT_SECRET,
                       index);
 }
 
 
-/**
- * Offer a payment identifier.
- *
- * @param index usually zero
- * @param h the payment identifier to offer.
- * @return #GNUNET_OK on success.
- */
 struct TALER_TESTING_Trait
-ANASTASIS_TESTING_make_trait_payment_identifier
+ANASTASIS_TESTING_make_trait_payment_secret
   (unsigned int index,
   const struct ANASTASIS_PaymentSecretP *h)
 {
   struct TALER_TESTING_Trait ret = {
     .index = index,
-    .trait_name = ANASTASIS_TESTING_TRAIT_PAYMENT_IDENTIFIER,
+    .trait_name = ANASTASIS_TESTING_TRAIT_PAYMENT_SECRET,
     .ptr = (const void *) h
   };
   return ret;
 }
 
 
-/* end of testing_api_trait_payment_identifier.c */
+/* end of testing_api_trait_payment_secret.c */
diff --git a/src/testing/testing_api_trait_payment_identifier.c 
b/src/testing/testing_api_trait_payment_secret.c
similarity index 75%
copy from src/testing/testing_api_trait_payment_identifier.c
copy to src/testing/testing_api_trait_payment_secret.c
index e27568a..6238879 100644
--- a/src/testing/testing_api_trait_payment_identifier.c
+++ b/src/testing/testing_api_trait_payment_secret.c
@@ -17,15 +17,15 @@
   <http://www.gnu.org/licenses/>
 */
 /**
- * @file lib/testing_api_trait_payment_identifier.c
+ * @file lib/testing_api_trait_payment_secret.c
  * @brief traits to offer a payment identifier
  * @author Dennis Neufeld
  */
 #include "platform.h"
 #include "anastasis_testing_lib.h"
 
-#define ANASTASIS_TESTING_TRAIT_PAYMENT_IDENTIFIER \
-  "anastasis-payment_identifier"
+#define ANASTASIS_TESTING_TRAIT_PAYMENT_SECRET \
+  "anastasis-payment_secret"
 
 
 /**
@@ -37,14 +37,14 @@
  * @return #GNUNET_OK on success.
  */
 int
-ANASTASIS_TESTING_get_trait_payment_identifier
+ANASTASIS_TESTING_get_trait_payment_secret
   (const struct TALER_TESTING_Command *cmd,
   unsigned int index,
-  const struct ANASTASIS_PaymentSecretP **payment_identifier)
+  const struct ANASTASIS_PaymentSecretP **payment_secret)
 {
   return cmd->traits (cmd->cls,
-                      (const void **) payment_identifier,
-                      ANASTASIS_TESTING_TRAIT_PAYMENT_IDENTIFIER,
+                      (const void **) payment_secret,
+                      ANASTASIS_TESTING_TRAIT_PAYMENT_SECRET,
                       index);
 }
 
@@ -57,17 +57,17 @@ ANASTASIS_TESTING_get_trait_payment_identifier
  * @return #GNUNET_OK on success.
  */
 struct TALER_TESTING_Trait
-ANASTASIS_TESTING_make_trait_payment_identifier
+ANASTASIS_TESTING_make_trait_payment_secret
   (unsigned int index,
   const struct ANASTASIS_PaymentSecretP *h)
 {
   struct TALER_TESTING_Trait ret = {
     .index = index,
-    .trait_name = ANASTASIS_TESTING_TRAIT_PAYMENT_IDENTIFIER,
+    .trait_name = ANASTASIS_TESTING_TRAIT_PAYMENT_SECRET,
     .ptr = (const void *) h
   };
   return ret;
 }
 
 
-/* end of testing_api_trait_payment_identifier.c */
+/* end of testing_api_trait_payment_secret.c */
diff --git a/src/testing/testing_api_trait_payment_identifier.c 
b/src/testing/testing_api_trait_truth_key.c
similarity index 51%
copy from src/testing/testing_api_trait_payment_identifier.c
copy to src/testing/testing_api_trait_truth_key.c
index e27568a..55094c1 100644
--- a/src/testing/testing_api_trait_payment_identifier.c
+++ b/src/testing/testing_api_trait_truth_key.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  Copyright (C) 2019 Taler Systems SA
+  Copyright (C) 2019, 2021 Taler Systems SA
 
   TALER is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published
@@ -17,57 +17,42 @@
   <http://www.gnu.org/licenses/>
 */
 /**
- * @file lib/testing_api_trait_payment_identifier.c
+ * @file lib/testing_api_trait_truth_key.c
  * @brief traits to offer a payment identifier
  * @author Dennis Neufeld
  */
 #include "platform.h"
 #include "anastasis_testing_lib.h"
 
-#define ANASTASIS_TESTING_TRAIT_PAYMENT_IDENTIFIER \
-  "anastasis-payment_identifier"
+#define ANASTASIS_TESTING_TRAIT_TRUTH_KEY \
+  "anastasis-truth_key"
 
 
-/**
- * Obtain an account public key from @a cmd.
- *
- * @param cmd command to extract the payment identifier from.
- * @param index the payment identifier's index number.
- * @param n[out] set to the payment identifier coming from @a cmd.
- * @return #GNUNET_OK on success.
- */
 int
-ANASTASIS_TESTING_get_trait_payment_identifier
+ANASTASIS_TESTING_get_trait_truth_key
   (const struct TALER_TESTING_Command *cmd,
   unsigned int index,
-  const struct ANASTASIS_PaymentSecretP **payment_identifier)
+  const struct ANASTASIS_CRYPTO_TruthKeyP **truth_key)
 {
   return cmd->traits (cmd->cls,
-                      (const void **) payment_identifier,
-                      ANASTASIS_TESTING_TRAIT_PAYMENT_IDENTIFIER,
+                      (const void **) truth_key,
+                      ANASTASIS_TESTING_TRAIT_TRUTH_KEY,
                       index);
 }
 
 
-/**
- * Offer a payment identifier.
- *
- * @param index usually zero
- * @param h the payment identifier to offer.
- * @return #GNUNET_OK on success.
- */
 struct TALER_TESTING_Trait
-ANASTASIS_TESTING_make_trait_payment_identifier
+ANASTASIS_TESTING_make_trait_truth_key
   (unsigned int index,
-  const struct ANASTASIS_PaymentSecretP *h)
+  const struct ANASTASIS_CRYPTO_TruthKeyP *h)
 {
   struct TALER_TESTING_Trait ret = {
     .index = index,
-    .trait_name = ANASTASIS_TESTING_TRAIT_PAYMENT_IDENTIFIER,
+    .trait_name = ANASTASIS_TESTING_TRAIT_TRUTH_KEY,
     .ptr = (const void *) h
   };
   return ret;
 }
 
 
-/* end of testing_api_trait_payment_identifier.c */
+/* end of testing_api_trait_truth_key.c */

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