enforced f-strings everywhere, %s on logging

extended _multiaddr_from_socket to support UDP and IPv6 automatically
changed TCPListener to use _ip4_or_6_from_multiaddr to get host, and not ip4 only

enforced `from error` everywhere with raises
added call braces to exceptions
This commit is contained in:
Jonathan de Jong
2019-12-19 17:31:18 +01:00
parent 6cf1b98a88
commit b1248ff315
16 changed files with 136 additions and 74 deletions

View File

@ -32,7 +32,7 @@ class ECCPublicKey(PublicKey):
return KeyType.ECC_P256
def verify(self, data: bytes, signature: bytes) -> bool:
raise NotImplementedError
raise NotImplementedError()
class ECCPrivateKey(PrivateKey):
@ -53,7 +53,7 @@ class ECCPrivateKey(PrivateKey):
return KeyType.ECC_P256
def sign(self, data: bytes) -> bytes:
raise NotImplementedError
raise NotImplementedError()
def get_public_key(self) -> PublicKey:
public_key_impl = keys.get_public_key(self.impl, self.curve)