File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed
tests/core/identity/identify Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change
1
+ Uses the `decapsulate ` method of the `Multiaddr ` class to clean up the observed address.
Original file line number Diff line number Diff line change @@ -56,16 +56,9 @@ async def test_identify_protocol(security_protocol):
56
56
)
57
57
58
58
# Check observed address
59
- # TODO: use decapsulateCode(protocols('p2p').code)
60
- # when the Multiaddr class will implement it
61
59
host_b_addr = host_b .get_addrs ()[0 ]
62
- cleaned_addr = Multiaddr .join (
63
- * (
64
- host_b_addr .split ()[:- 1 ]
65
- if str (host_b_addr .split ()[- 1 ]).startswith ("/p2p/" )
66
- else host_b_addr .split ()
67
- )
68
- )
60
+ host_b_peer_id = host_b .get_id ()
61
+ cleaned_addr = host_b_addr .decapsulate (Multiaddr (f"/p2p/{ host_b_peer_id } " ))
69
62
70
63
logger .debug ("observed_addr: %s" , Multiaddr (identify_response .observed_addr ))
71
64
logger .debug ("host_b.get_addrs()[0]: %s" , host_b .get_addrs ()[0 ])
You can’t perform that action at this time.
0 commit comments