From de8d356955f097415c41a82382bab0723f977bc0 Mon Sep 17 00:00:00 2001 From: mhchia Date: Sat, 17 Aug 2019 22:11:08 +0800 Subject: [PATCH] Fix tests failure due to lack of peer id Fix it through doing plaintext handshake. --- libp2p/security/simple/transport.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libp2p/security/simple/transport.py b/libp2p/security/simple/transport.py index 7a19a9f..8eed2a6 100644 --- a/libp2p/security/simple/transport.py +++ b/libp2p/security/simple/transport.py @@ -30,6 +30,10 @@ class SimpleSecurityTransport(BaseSecureTransport): ) session = InsecureSession(self, conn, ID(b"")) + # TODO: Calls handshake to make them know the peer id each other, otherwise tests fail. + # However, it seems pretty weird that `SimpleSecurityTransport` sends peer id through + # `Insecure`. + await session.run_handshake() # NOTE: this is abusing the abstraction we have here # but this code may be deprecated soon and this exists # mainly to satisfy a test that will go along w/ it @@ -56,6 +60,10 @@ class SimpleSecurityTransport(BaseSecureTransport): ) session = InsecureSession(self, conn, peer_id) + # TODO: Calls handshake to make them know the peer id each other, otherwise tests fail. + # However, it seems pretty weird that `SimpleSecurityTransport` sends peer id through + # `Insecure`. + await session.run_handshake() # NOTE: this is abusing the abstraction we have here # but this code may be deprecated soon and this exists # mainly to satisfy a test that will go along w/ it