gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 52/70: - working did lib and 1. test for did helper


From: gnunet
Subject: [gnunet] 52/70: - working did lib and 1. test for did helper
Date: Wed, 31 Aug 2022 18:00:46 +0200

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

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

commit 8d8e46d04de08c33b0c625eaef022b0020fce314
Author: Tristan Schwieren <tristan.schwieren@tum.de>
AuthorDate: Fri May 27 14:58:30 2022 +0200

    - working did lib and 1. test for did helper
---
 src/Makefile.am               |  3 +--
 src/reclaim/Makefile.am       |  2 +-
 src/reclaim/test_did_helper.c | 14 ++++++--------
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 06d018c56..4c665c3b3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,8 +6,7 @@ TESTBED = testbed-logger testbed
 if HAVE_EXPERIMENTAL
  EXP_DIR = \
   rps \
-  abd \
-  did
+  abd
 if HAVE_ABE
  EXP_DIR += \
   abe
diff --git a/src/reclaim/Makefile.am b/src/reclaim/Makefile.am
index d9e27a0ee..3f3419722 100644
--- a/src/reclaim/Makefile.am
+++ b/src/reclaim/Makefile.am
@@ -203,7 +203,7 @@ test_reclaim_attribute_LDADD = \
   $(GN_LIBINTL)
 
 gnunet_did_SOURCES = \
-       gnunet-did.c \
+       gnunet-did.c
 gnunet_did_LDADD = \
        $(top_builddir)/src/util/libgnunetutil.la \
        $(top_builddir)/src/gns/libgnunetgns.la \
diff --git a/src/reclaim/test_did_helper.c b/src/reclaim/test_did_helper.c
index 55b98b085..873cb85cf 100644
--- a/src/reclaim/test_did_helper.c
+++ b/src/reclaim/test_did_helper.c
@@ -31,25 +31,25 @@
 #include "gnunet_gnsrecord_lib.h"
 #include "did_helper.h"
 
-static char test_privkey[32] = {
+static const char test_privkey[32] = {
   0x9b, 0x93, 0x7b, 0x81, 0x32, 0x2d, 0x81, 0x6c,
   0xfa, 0xb9, 0xd5, 0xa3, 0xba, 0xac, 0xc9, 0xb2,
   0xa5, 0xfe, 0xbe, 0x4b, 0x14, 0x9f, 0x12, 0x6b,
   0x36, 0x30, 0xf9, 0x3a, 0x29, 0x52, 0x70, 0x17
 };
 
+static const char *test_did = 
"did:reclaim:000G0509BYD1MPAXVSTNV0KRD1JAT0YZMPJFQNM869B66S72PSF17K4Y8G";
+
 static struct GNUNET_IDENTITY_PrivateKey skey;
 static struct GNUNET_IDENTITY_PublicKey pkey;
 
-int
+// TODO: Create a did manual from private key / independet of implementation
+void
 test_GNUNET_DID_pkey_to_did ()
 {
   char *str_did;
   str_did = GNUNET_DID_pkey_to_did(&pkey);
-  printf("%s\n", str_did);
-
-  // TODO: Give to function, compare to real DID
-  return 0;
+  GNUNET_assert(strcmp(test_did, str_did) == 0);
 }
 
 int
@@ -69,7 +69,5 @@ main ()
   GNUNET_IDENTITY_key_get_public (&skey, &pkey);
 
   test_GNUNET_DID_pkey_to_did();
-
-  GNUNET_assert (0 == 0);
   return 0;
 }
\ No newline at end of file

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