[fix] Ws api tests (#31)

This commit is contained in:
Vlad Stan 2024-11-11 15:25:25 +02:00 committed by GitHub
parent 73054fd5ce
commit 3dc066fbd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 108 additions and 44 deletions

View file

@ -103,8 +103,16 @@ class NostrClientConnection:
return []
message_type = data[0]
if message_type == NostrEventType.EVENT:
await self._handle_event(NostrEvent.parse_obj(data[1]))
event_dict = {
"relay_id": self.relay_id,
"publisher": data[1]["pubkey"],
**data[1],
}
event = NostrEvent(**event_dict)
await self._handle_event(event)
return []
if message_type == NostrEventType.REQ:
if len(data) != 3:
@ -146,7 +154,6 @@ class NostrClientConnection:
resp_nip20 += [valid, message]
await self._send_msg(resp_nip20)
return None
try:
if e.is_replaceable_event:
await delete_events(