better method names

This commit is contained in:
jeffthibault
2022-07-20 16:14:30 -04:00
parent 2a39c9d524
commit 3f1b96273d
2 changed files with 4 additions and 4 deletions

View File

@@ -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,

View File

@@ -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