Clean up peer.ID
This commit is contained in:
parent
c40314a043
commit
f9e859a8e9
|
@ -28,10 +28,10 @@ class ID:
|
||||||
self._b58_str = base58.b58encode(self._bytes).decode()
|
self._b58_str = base58.b58encode(self._bytes).decode()
|
||||||
return self._b58_str
|
return self._b58_str
|
||||||
|
|
||||||
def __bytes__(self) -> bytes:
|
def __repr__(self) -> str:
|
||||||
return self._bytes
|
return "<libp2p.peer.id.ID 0x" + self._bytes.hex() + ">"
|
||||||
|
|
||||||
__repr__ = __str__ = pretty = to_string = to_base58
|
__str__ = pretty = to_string = to_base58
|
||||||
|
|
||||||
def __eq__(self, other: object) -> bool:
|
def __eq__(self, other: object) -> bool:
|
||||||
if isinstance(other, str):
|
if isinstance(other, str):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user