mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Mock dependencies that are excluded in readthedocs
It seems preferable to import just fastecdsa. But if you do that, then some kind of side-effect doesn't happen, which means that `sec1` is not available as an attribute on `fastecdsa.encoding`. So we specifically mock the sub-modules as well.
This commit is contained in:
@ -1,12 +1,14 @@
|
||||
from typing import Callable, Tuple, cast
|
||||
|
||||
from fastecdsa.encoding.util import int_bytelen
|
||||
from fastecdsa.encoding import util
|
||||
|
||||
from libp2p.crypto.ecc import ECCPrivateKey, ECCPublicKey, create_new_key_pair
|
||||
from libp2p.crypto.keys import PublicKey
|
||||
|
||||
SharedKeyGenerator = Callable[[bytes], bytes]
|
||||
|
||||
int_bytelen = util.int_bytelen
|
||||
|
||||
|
||||
def create_ephemeral_key_pair(curve_type: str) -> Tuple[PublicKey, SharedKeyGenerator]:
|
||||
"""Facilitates ECDH key exchange."""
|
||||
|
||||
Reference in New Issue
Block a user