Skip to content

Commit

Permalink
add: 'eq' and 'repr' in node class
Browse files Browse the repository at this point in the history
  • Loading branch information
olivmath committed Dec 24, 2023
1 parent 8f0aaf8 commit edcf1f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion merkly/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ class Node(BaseModel):
# 🍃 Leaf of Merkle Tree
"""

data: Optional[str] = None
data: Optional[bytes] = None
side: Side = Side.LEFT

def __eq__(self, other: "Node") -> bool:
return self.data == other.data

def __repr__(self) -> str:
return f"Node({self.data.hex()}, {self.side})"

0 comments on commit edcf1f8

Please sign in to comment.