commit e588903a7de74f556afab31fa7d7b598168c7fbf
parent f0beae9326c9e197e5159a7f68c0e85e6e659e91
Author: William Casarin <jb55@jb55.com>
Date: Fri, 21 Mar 2025 14:46:26 -0700
debug: add a print for debugging rust integration
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/nostrdb.c b/src/nostrdb.c
@@ -2642,6 +2642,7 @@ static int ndb_process_note_relay(struct ndb_txn *txn, struct ndb_writer_msg *ou
// if not, tell the writer thread to emit a NOTE_RELAY event
out->type = NDB_WRITER_NOTE_RELAY;
+ ndb_debug("pushing NDB_WRITER_NOTE_RELAY with note_key %" PRIu64 "\n", note_key);
out->note_relay.relay = relay;
out->note_relay.note_key = note_key;
out->note_relay.kind = ndb_note_kind(note);
diff --git a/test.c b/test.c
@@ -1812,6 +1812,8 @@ static void test_note_relay_index()
assert(ndb_process_event_with(ndb, json, strlen(json), &meta));
meta.relay = "wss://nostr.mom";
assert(ndb_process_event_with(ndb, json, strlen(json), &meta));
+ meta.relay = "ws://monad.jb55.com:8080";
+ assert(ndb_process_event_with(ndb, json, strlen(json), &meta));
assert(ndb_wait_for_notes(ndb, subid, ¬e_key, 1) == 1);
assert(note_key > 0);
@@ -1823,6 +1825,7 @@ static void test_note_relay_index()
assert(ndb_note_seen_on_relay(&txn, note_key, "wss://relay.damus.io"));
assert(ndb_note_seen_on_relay(&txn, note_key, "wss://relay.mit.edu"));
assert(ndb_note_seen_on_relay(&txn, note_key, "wss://nostr.mom"));
+ assert(ndb_note_seen_on_relay(&txn, note_key, "ws://monad.jb55.com:8080"));
// walk the relays
struct ndb_note_relay_iterator iter;
@@ -1831,6 +1834,10 @@ static void test_note_relay_index()
relay = ndb_note_relay_iterate_next(&iter);
assert(relay);
+ assert(!strcmp(relay, "ws://monad.jb55.com:8080"));
+
+ relay = ndb_note_relay_iterate_next(&iter);
+ assert(relay);
assert(!strcmp(relay, "wss://nostr.mom"));
relay = ndb_note_relay_iterate_next(&iter);