aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-02-13 00:46:46 +0100
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:12 +0200
commit00a2777fc154537fe9fc9cfac082a29f70bf6b75 (patch)
tree8c8a1489afe9d430cfdb1a19c63341d320f7543e /tests
parenta9a7ecaa25e6bc11062e21affd458e2de78747ff (diff)
Add database storage (in memory), need to store it on disk later
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp17
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)