diff options
author | Aleksi Lindeman <0xdec05eba@gmail.com> | 2018-02-13 00:46:46 +0100 |
---|---|---|
committer | Aleksi Lindeman <0xdec05eba@gmail.com> | 2018-02-13 00:46:54 +0100 |
commit | 9cd9c99e4bb4bbace8ba2d4a2dbd6830750ad521 (patch) | |
tree | 2fa81b1f61f2fd04e99c832e5dee8dd2af6cf333 /tests | |
parent | f24cd8b5708bdaf538508bfbca837299cecfba5b (diff) |
Add database storage (in memory), need to store it on disk later
Diffstat (limited to 'tests')
-rw-r--r-- | tests/main.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
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) |