diff --git a/libp2p/peer/id.py b/libp2p/peer/id.py index 47d7cf5..3097e1f 100644 --- a/libp2p/peer/id.py +++ b/libp2p/peer/id.py @@ -27,9 +27,7 @@ class ID: def __str__(self): pid = self.pretty() - if len(pid) <= 10: - return "" % pid - return "" % (pid[:2], pid[len(pid)-6:]) + return pid __repr__ = __str__ diff --git a/tests/peer/test_peerid.py b/tests/peer/test_peerid.py index f7c82cb..d1cf718 100644 --- a/tests/peer/test_peerid.py +++ b/tests/peer/test_peerid.py @@ -36,7 +36,7 @@ def test_str_less_than_10(): for _ in range(5): random_id_string += random.SystemRandom().choice(ALPHABETS) pid = base58.b58encode(random_id_string).decode() - expected = "" + expected = pid actual = ID(random_id_string).__str__() assert actual == expected @@ -46,9 +46,7 @@ def test_str_more_than_10(): for _ in range(10): random_id_string += random.SystemRandom().choice(ALPHABETS) pid = base58.b58encode(random_id_string).decode() - part_1, part_2 = pid[:2], pid[len(pid)-6:] - - expected = "" + expected = pid actual = ID(random_id_string).__str__() assert actual == expected