Fix Event default timestamp (#24)

Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
Ryan Armstrong
2023-01-19 11:29:25 -08:00
committed by GitHub
parent 3a903b77ab
commit 87f4207b88
2 changed files with 11 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ class Event():
self,
public_key: str,
content: str,
created_at: int=int(time.time()),
created_at: int = None,
kind: int=EventKind.TEXT_NOTE,
tags: "list[list[str]]"=[],
id: str=None,
@@ -30,7 +30,7 @@ class Event():
self.id = id if not id is None else Event.compute_id(public_key, created_at, kind, tags, content)
self.public_key = public_key
self.content = content
self.created_at = created_at
self.created_at = created_at or int(time.time())
self.kind = kind
self.tags = tags
self.signature = signature