V1 (#106)
Some checks failed
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled

This commit is contained in:
Vlad Stan 2024-11-06 11:50:21 +02:00 committed by GitHub
commit de7fe059b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 6679 additions and 3115 deletions

View file

@ -13,7 +13,7 @@ class NostrEvent(BaseModel):
kind: int
tags: List[List[str]] = []
content: str = ""
sig: Optional[str]
sig: Optional[str] = None
def serialize(self) -> List:
return [0, self.pubkey, self.created_at, self.kind, self.tags, self.content]
@ -41,7 +41,7 @@ class NostrEvent(BaseModel):
f"Invalid public key: '{self.pubkey}' for event '{self.id}'"
)
valid_signature = pub_key.schnorr_verify(
valid_signature = self.sig and pub_key.schnorr_verify(
bytes.fromhex(event_id), bytes.fromhex(self.sig), None, raw=True
)
if not valid_signature: