mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
run black w/ extended line length
This commit is contained in:
committed by
Kevin Mai-Husan Chia
parent
905dfa9a8d
commit
7477b29508
@ -29,9 +29,7 @@ class InsecureTransport(ISecureTransport):
|
||||
insecure_conn = InsecureConn(conn, self.transport_id)
|
||||
return insecure_conn
|
||||
|
||||
async def secure_outbound(
|
||||
self, conn: "IRawConnection", peer_id: "ID"
|
||||
) -> ISecureConn:
|
||||
async def secure_outbound(self, conn: "IRawConnection", peer_id: "ID") -> ISecureConn:
|
||||
"""
|
||||
Secure the connection, either locally or by communicating with opposing node via conn,
|
||||
for an inbound connection (i.e. we are the initiator)
|
||||
|
||||
@ -25,9 +25,7 @@ class ISecureTransport(ABC):
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
async def secure_outbound(
|
||||
self, conn: "IRawConnection", peer_id: "ID"
|
||||
) -> "ISecureConn":
|
||||
async def secure_outbound(self, conn: "IRawConnection", peer_id: "ID") -> "ISecureConn":
|
||||
"""
|
||||
Secure the connection, either locally or by communicating with opposing node via conn,
|
||||
for an inbound connection (i.e. we are the initiator)
|
||||
|
||||
@ -61,9 +61,7 @@ class SecurityMultistream(ABC):
|
||||
|
||||
return secure_conn
|
||||
|
||||
async def secure_outbound(
|
||||
self, conn: "IRawConnection", peer_id: "ID"
|
||||
) -> "ISecureConn":
|
||||
async def secure_outbound(self, conn: "IRawConnection", peer_id: "ID") -> "ISecureConn":
|
||||
"""
|
||||
Secure the connection, either locally or by communicating with opposing node via conn,
|
||||
for an inbound connection (i.e. we are the initiator)
|
||||
@ -78,9 +76,7 @@ class SecurityMultistream(ABC):
|
||||
|
||||
return secure_conn
|
||||
|
||||
async def select_transport(
|
||||
self, conn: "IRawConnection", initiator: bool
|
||||
) -> "ISecureTransport":
|
||||
async def select_transport(self, conn: "IRawConnection", initiator: bool) -> "ISecureTransport":
|
||||
"""
|
||||
Select a transport that both us and the node on the
|
||||
other end of conn support and agree on
|
||||
|
||||
@ -26,16 +26,12 @@ class SimpleSecurityTransport(ISecureTransport):
|
||||
incoming = (await conn.read()).decode()
|
||||
|
||||
if incoming != self.key_phrase:
|
||||
raise Exception(
|
||||
"Key phrase differed between nodes. Expected " + self.key_phrase
|
||||
)
|
||||
raise Exception("Key phrase differed between nodes. Expected " + self.key_phrase)
|
||||
|
||||
secure_conn = SimpleSecureConn(conn, self.key_phrase)
|
||||
return secure_conn
|
||||
|
||||
async def secure_outbound(
|
||||
self, conn: "IRawConnection", peer_id: "ID"
|
||||
) -> "ISecureConn":
|
||||
async def secure_outbound(self, conn: "IRawConnection", peer_id: "ID") -> "ISecureConn":
|
||||
"""
|
||||
Secure the connection, either locally or by communicating with opposing node via conn,
|
||||
for an inbound connection (i.e. we are the initiator)
|
||||
@ -49,9 +45,7 @@ class SimpleSecurityTransport(ISecureTransport):
|
||||
await asyncio.sleep(0)
|
||||
|
||||
if incoming != self.key_phrase:
|
||||
raise Exception(
|
||||
"Key phrase differed between nodes. Expected " + self.key_phrase
|
||||
)
|
||||
raise Exception("Key phrase differed between nodes. Expected " + self.key_phrase)
|
||||
|
||||
secure_conn = SimpleSecureConn(conn, self.key_phrase)
|
||||
return secure_conn
|
||||
|
||||
Reference in New Issue
Block a user