mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Merge branch 'main' into identify-fix-varint-go
This commit is contained in:
@ -13,7 +13,9 @@ from libp2p.peer.peerinfo import (
|
||||
)
|
||||
|
||||
ALPHABETS = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|
||||
VALID_MULTI_ADDR_STR = "/ip4/127.0.0.1/tcp/8000/p2p/3YgLAeMKSAPcGqZkAt8mREqhQXmJT8SN8VCMN4T6ih4GNX9wvK8mWJnWZ1qA2mLdCQ" # noqa: E501
|
||||
VALID_MULTI_ADDR_STR = (
|
||||
"/ip4/127.0.0.1/tcp/8000/p2p/QmWQqHcMi6Cay5M6KWSNVYSDnxzfqWb1aGFQFSRzBNe49t"
|
||||
)
|
||||
|
||||
|
||||
def test_init_():
|
||||
@ -50,9 +52,6 @@ def test_info_from_p2p_addr_invalid(addr):
|
||||
def test_info_from_p2p_addr_valid():
|
||||
m_addr = multiaddr.Multiaddr(VALID_MULTI_ADDR_STR)
|
||||
info = info_from_p2p_addr(m_addr)
|
||||
assert (
|
||||
info.peer_id.pretty()
|
||||
== "3YgLAeMKSAPcGqZkAt8mREqhQXmJT8SN8VCMN4T6ih4GNX9wvK8mWJnWZ1qA2mLdCQ"
|
||||
)
|
||||
assert info.peer_id.pretty() == "QmWQqHcMi6Cay5M6KWSNVYSDnxzfqWb1aGFQFSRzBNe49t"
|
||||
assert len(info.addrs) == 1
|
||||
assert str(info.addrs[0]) == "/ip4/127.0.0.1/tcp/8000"
|
||||
|
||||
Reference in New Issue
Block a user