mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Add automatic docstring formatter and apply
This commit is contained in:
@ -6,10 +6,8 @@ from libp2p.crypto.keys import KeyPair, KeyType, PrivateKey, PublicKey
|
||||
|
||||
|
||||
def infer_local_type(curve: str) -> curve_types.Curve:
|
||||
"""
|
||||
converts a ``str`` representation of some elliptic curve to
|
||||
a representation understood by the backend of this module.
|
||||
"""
|
||||
"""converts a ``str`` representation of some elliptic curve to a
|
||||
representation understood by the backend of this module."""
|
||||
if curve == "P-256":
|
||||
return curve_types.P256
|
||||
else:
|
||||
@ -63,9 +61,8 @@ class ECCPrivateKey(PrivateKey):
|
||||
|
||||
|
||||
def create_new_key_pair(curve: str) -> KeyPair:
|
||||
"""
|
||||
Return a new ECC keypair with the requested ``curve`` type, e.g. "P-256".
|
||||
"""
|
||||
"""Return a new ECC keypair with the requested ``curve`` type, e.g.
|
||||
"P-256"."""
|
||||
private_key = ECCPrivateKey.new(curve)
|
||||
public_key = private_key.get_public_key()
|
||||
return KeyPair(private_key, public_key)
|
||||
|
||||
Reference in New Issue
Block a user