File tree 4 files changed +18
-6
lines changed
4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 1
1
[format ]
2
- # Exclude the file taken from Bitcoin Core for now, in case we want to
3
- # contribute our changes back to upstream.
4
- exclude = [" secp256k1lab/secp256k1.py" ]
2
+ # Exclude vendored package.
3
+ exclude = [" secp256k1lab/*" ]
Original file line number Diff line number Diff line change
1
+ from pathlib import Path
2
+ import sys
3
+
4
+
1
5
__all__ = ["chilldkg" ]
6
+
7
+ # Prefer the vendored copy of secp256k1lab.
8
+ sys .path .insert (0 , str (Path (__file__ ).parent / "../secp256k1lab/src" ))
Original file line number Diff line number Diff line change
1
+ [mypy]
2
+ # Include path to vendored copy of secp256k1lab, in order to
3
+ # avoid "import-not-found" errors in mypy's `--strict` mode
4
+ mypy_path = $MYPY_CONFIG_FILE_DIR/secp256k1lab/src
Original file line number Diff line number Diff line change 7
7
from typing import Tuple , List , Optional
8
8
from secrets import token_bytes as random_bytes
9
9
10
- from secp256k1lab .secp256k1 import GE , G , Scalar
11
- from secp256k1lab .keys import pubkey_gen_plain
12
-
13
10
from chilldkg_ref .util import (
14
11
FaultyParticipantOrCoordinatorError ,
15
12
FaultyCoordinatorError ,
21
18
import chilldkg_ref .encpedpop as encpedpop
22
19
import chilldkg_ref .chilldkg as chilldkg
23
20
21
+ # Import from secp256k1lab after the chilldkg_ref imports because the latter
22
+ # modifies sys.path to make sure the vendored copy of secp256k1lab is found.
23
+ from secp256k1lab .secp256k1 import GE , G , Scalar
24
+ from secp256k1lab .keys import pubkey_gen_plain
25
+
24
26
from example import simulate_chilldkg_full as simulate_chilldkg_full_example
25
27
26
28
You can’t perform that action at this time.
0 commit comments