commit 31c08419ae49a203670859a927394de01f9f5b98
parent 9ce284a2f6d91bd1ae3786aec9010559a0986965
Author: William Casarin <jb55@jb55.com>
Date: Sat, 7 Oct 2023 17:37:30 -0700
test: update replacement test
Diffstat:
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/test.c b/test.c
@@ -393,15 +393,12 @@ static void test_replacement()
read_file("testdata/old-new.json", (unsigned char*)json, alloc_size, &written);
assert(ndb_process_events(ndb, json, written));
- ndb_destroy(ndb);
- assert(ndb_init(&ndb, test_dir, mapsize, ingester_threads, 0));
+ usleep(1000); // 1ms, works at 0.1ms too
struct ndb_txn txn;
assert(ndb_begin_query(ndb, &txn));
- unsigned char pubkey[32] = { 0xb8, 0x2b, 0x25, 0x00, 0x60, 0x47, 0xd9, 0xb3, 0xf7, 0x64, 0x1f, 0x2a,
- 0x9c, 0xde, 0x04, 0x07, 0x69, 0x7b, 0xb5, 0x7d, 0x97, 0x93, 0x9a, 0xd1,
- 0xd1, 0x49, 0xa7, 0x00, 0xc4, 0x3b, 0x59, 0x74 };
+ unsigned char pubkey[32] = { 0x1e, 0x48, 0x9f, 0x6a, 0x4f, 0xc5, 0xc7, 0xac, 0x47, 0x5e, 0xa9, 0x04, 0x17, 0x43, 0xb8, 0x53, 0x11, 0x73, 0x25, 0x92, 0x61, 0xec, 0x71, 0x54, 0x26, 0x41, 0x05, 0x1e, 0x22, 0xa3, 0x82, 0xac };
void *root = ndb_get_profile_by_pubkey(&txn, pubkey, &len, NULL);
diff --git a/testdata/old-new.json b/testdata/old-new.json
@@ -1,2 +1,3 @@
-["EVENT","a",{"id": "35cadc4ddab69648bb6a1d7ea583178e7005594088b14b46a12c32b828692177","pubkey": "b82b25006047d9b3f7641f2a9cde0407697bb57d97939ad1d149a700c43b5974","created_at": 1693519672,"kind": 0,"tags": [],"content": "{}","sig": "34216cf29eae39c1212eec270c173b38736e97be2ddb2025ff55aba65638a73f687f9252e6a9bcf7cfde5ba0329ae177562a24059f03de3ee306877bc22a309b"}]
-["EVENT","b",{"id": "80e5308829a48da47dcba7bd3e5a4cf193d3de91146b98721aa39348524ce0e7","pubkey": "b82b25006047d9b3f7641f2a9cde0407697bb57d97939ad1d149a700c43b5974","created_at": 1693519687,"kind": 0,"tags": [],"content": "{\"name\":\"jb55\"}","sig": "b521639be8583e31c9464083ff1b1df3b65b0b4cccc50ac2cee8436ba945376cf5c057204077261314f18c942a89982b7305a77591ae42c05b3670a0e79e00b7"}]
+["EVENT", "a", {"id": "1550ff0e62ef2b3872375cb522dd7c31137b395cc82ab70f7184369a88a2ff57","pubkey": "1e489f6a4fc5c7ac475ea9041743b8531173259261ec71542641051e22a382ac","created_at": 1696725047,"kind": 0,"tags": [],"content": "{\"name\":\"jb\"}","sig": "0751cb2f0319a225dfbee941a6051e8d1f23b6d150178daa8cdae0e663761c96320ada7de5fb9710d354da854c309b3c97bc803dc3e82c9f7fcf2a848a06b0eb"}]
+["EVENT", "b", {"id": "bbc63aa1c5931fa77c89bba4c806a720454dd0e101143b3a446f28383661f1c6","pubkey": "1e489f6a4fc5c7ac475ea9041743b8531173259261ec71542641051e22a382ac","created_at": 1696725051,"kind": 0,"tags": [],"content": "{\"name\":\"jb55\"}","sig": "b9fc5d23694d0f618502cb8dcc7838c20cebb3e0068991bea546fe0d2dc5757b1d0d13e6d49aff7191a9ddd60c6956067091b225dc217fe104f356cd80849948"}]
+