From 9cd9c99e4bb4bbace8ba2d4a2dbd6830750ad521 Mon Sep 17 00:00:00 2001 From: Aleksi Lindeman <0xdec05eba@gmail.com> Date: Tue, 13 Feb 2018 00:46:46 +0100 Subject: Add database storage (in memory), need to store it on disk later --- tests/main.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'tests') diff --git a/tests/main.cpp b/tests/main.cpp index 5e53dc8..8818ff9 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -18,19 +18,6 @@ int main() std::string privateKeyStr = localUser->getPrivateKey().toString(); printf("Local user private key: %s\n", privateKeyStr.c_str()); - -/* - char hex_ed_pk[65]; - unsigned char seed[crypto_sign_ed25519_SEEDBYTES]; - unsigned char ed25519_skpk[crypto_sign_ed25519_SECRETKEYBYTES]; - unsigned char ed25519_pk[crypto_sign_ed25519_PUBLICKEYBYTES]; - - crypto_sign_ed25519_sk_to_seed(seed, ed25519_skpk); - crypto_sign_ed25519_seed_keypair(ed25519_pk, ed25519_skpk, seed); - sodium_bin2hex(hex_ed_pk, 65, ed25519_pk, 32); - printf("public key: %s\n", hex_ed_pk); - */ - // TODO: For tests, dont run against bootstrap.ring.cx. // Run against a bootstrap node made only for testing which doesn't persist added data. @@ -42,8 +29,8 @@ int main() group.addUser(localUser); database.create("galax.channel.latenight.chat", &group); - //const char *data = "hello, world!"; - //database.add("galax.channel.latenight.chat", DataView{ (void*)data, strlen(data) }); + const char *data = "hello, world!"; + database.add("galax.channel.latenight.chat", DataView{ (void*)data, strlen(data) }, localUser); database.commit(); auto start = chrono::high_resolution_clock::now(); while(chrono::high_resolution_clock::now() - start < 5s) -- cgit v1.2.3