From dbd4ed44dd7fe76bf4ea4a1ad17fd46f536d2b9c Mon Sep 17 00:00:00 2001 From: mhchia Date: Thu, 22 Aug 2019 15:36:17 +0800 Subject: [PATCH 1/2] Fix the issue when importing from other package --- libp2p/security/insecure/__init__.py | 0 libp2p/security/simple/__init__.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 libp2p/security/insecure/__init__.py create mode 100644 libp2p/security/simple/__init__.py diff --git a/libp2p/security/insecure/__init__.py b/libp2p/security/insecure/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/libp2p/security/simple/__init__.py b/libp2p/security/simple/__init__.py new file mode 100644 index 0000000..e69de29 From 2752e7a04b2eaab6b1c924e1a91665ab3bedbdfc Mon Sep 17 00:00:00 2001 From: mhchia Date: Thu, 22 Aug 2019 15:58:10 +0800 Subject: [PATCH 2/2] Ignore mypy error here --- libp2p/security/simple/transport.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libp2p/security/simple/transport.py b/libp2p/security/simple/transport.py index 5ff07cd..7a19a9f 100644 --- a/libp2p/security/simple/transport.py +++ b/libp2p/security/simple/transport.py @@ -33,7 +33,8 @@ class SimpleSecurityTransport(BaseSecureTransport): # 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 - session.key_phrase = self.key_phrase + # FIXME: Enable type check back when we can deprecate the simple transport. + session.key_phrase = self.key_phrase # type: ignore return session async def secure_outbound(self, conn: IRawConnection, peer_id: ID) -> ISecureConn: @@ -58,5 +59,6 @@ class SimpleSecurityTransport(BaseSecureTransport): # 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 - session.key_phrase = self.key_phrase + # FIXME: Enable type check back when we can deprecate the simple transport. + session.key_phrase = self.key_phrase # type: ignore return session