run black w/ extended line length

This commit is contained in:
Alex Stokes
2019-08-03 11:25:25 -07:00
committed by Kevin Mai-Husan Chia
parent 905dfa9a8d
commit 7477b29508
33 changed files with 71 additions and 229 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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