Refactor ID to take in type bytes only

This commit is contained in:
NIC619
2019-07-31 19:26:13 +08:00
parent f6e456c96e
commit 80481252ca
6 changed files with 56 additions and 58 deletions

View File

@ -19,7 +19,7 @@ def test_init_():
random_id_string = ""
for _ in range(10):
random_id_string += random.SystemRandom().choice(ALPHABETS)
peer_id = ID(random_id_string)
peer_id = ID(random_id_string.encode())
peer_info = PeerInfo(peer_id, peer_data)
assert peer_info.peer_id == peer_id