From 3f1b96273dd0127f47f855a6859c78137bc1d7b8 Mon Sep 17 00:00:00 2001 From: jeffthibault Date: Wed, 20 Jul 2022 16:14:30 -0400 Subject: [PATCH] better method names --- nostr/event.py | 2 +- nostr/filter.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nostr/event.py b/nostr/event.py index d79aaa0..13f06a8 100644 --- a/nostr/event.py +++ b/nostr/event.py @@ -45,7 +45,7 @@ class Event(): pub_key = PublicKey(bytes.fromhex("02" + self.public_key), True) # add 02 for schnorr (bip340) return pub_key.schnorr_verify(bytes.fromhex(self.id), bytes.fromhex(self.signature), None, raw=True) - def to_dict(self) -> dict: + def to_json_object(self) -> dict: return { "id": self.id, "pubkey": self.public_key, diff --git a/nostr/filter.py b/nostr/filter.py index 1cd36dc..4259c6e 100644 --- a/nostr/filter.py +++ b/nostr/filter.py @@ -43,7 +43,7 @@ class Filter: return True - def to_json(self) -> dict: + def to_json_object(self) -> dict: res = {} if self.IDs != None: res["ids"] = self.IDs @@ -74,9 +74,9 @@ class Filters(UserList): return True return False - def to_json(self) -> list: + def to_json_array(self) -> list: res = [] for filter in self.data: - res.append(filter.to_json()) + res.append(filter.to_json_object()) return res \ No newline at end of file