Use types for {Private,Public}Key and address other missing type hints

This commit is contained in:
Alex Stokes
2019-08-15 16:26:22 -07:00
parent e7d2681fc0
commit 2e3ffb9d53
5 changed files with 26 additions and 28 deletions

View File

@ -1,3 +1,4 @@
from libp2p.crypto.keys import PrivateKey, PublicKey
from libp2p.peer.id import ID
from libp2p.security.secure_transport_interface import ISecureTransport
@ -8,6 +9,8 @@ class BaseSecureTransport(ISecureTransport):
is only meant to be used in clases that derive from it.
"""
def __init__(self, local_private_key: bytes, local_public_key: bytes) -> None:
def __init__(
self, local_private_key: PrivateKey, local_public_key: PublicKey
) -> None:
self.local_private_key = local_private_key
self.local_peer = ID.from_pubkey(local_public_key)