tests on root and khatru working.

This commit is contained in:
fiatjaf
2025-04-17 20:30:44 -03:00
parent 1c56906506
commit 32efaa7c58
13 changed files with 56 additions and 74 deletions

View File

@@ -183,7 +183,7 @@ func TestBasicRelayFunctionality(t *testing.T) {
// create newer event that should replace the first
evt2 := createEvent(sk1, 0, `{"name":"newer"}`, nil)
evt2.CreatedAt = 2000 // Newer timestamp
evt2.CreatedAt = 2004 // Newer timestamp
evt2.Sign(sk1)
err = client1.Publish(ctx, evt2)
if err != nil {
@@ -213,8 +213,8 @@ func TestBasicRelayFunctionality(t *testing.T) {
var receivedEvents []nostr.Event
for {
select {
case env := <-sub.Events:
receivedEvents = append(receivedEvents, env)
case evt := <-sub.Events:
receivedEvents = append(receivedEvents, evt)
case <-sub.EndOfStoredEvents:
if len(receivedEvents) != 1 {
t.Errorf("expected exactly 1 event, got %d", len(receivedEvents))