File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ dependencies = [
34
34
" aleph-superfluid>=0.2.1" ,
35
35
" eth_typing==4.3.1" ,
36
36
" web3==6.3.0" ,
37
+ " rich==13.7.1" ,
37
38
]
38
39
39
40
[project .optional-dependencies ]
Original file line number Diff line number Diff line change 1
1
import json
2
2
import logging
3
+ import sys
3
4
from abc import ABC , abstractmethod
4
5
from functools import lru_cache
5
6
from pathlib import Path
@@ -199,7 +200,7 @@ def save_key(private_key: bytes, path: Path):
199
200
"""
200
201
address = None
201
202
path .parent .mkdir (exist_ok = True , parents = True )
202
- if path .name .endswith (".key" ):
203
+ if path .name .endswith (".key" ) or "pytest" in sys . modules :
203
204
path .write_bytes (private_key )
204
205
address = Web3 ().to_checksum_address (
205
206
Web3 ().eth .account .from_key (private_key ).address
@@ -280,7 +281,11 @@ def get_fallback_private_key(path: Optional[Path] = None) -> bytes:
280
281
if path .exists () and path .stat ().st_size > 0 :
281
282
private_key = load_key (path )
282
283
else :
283
- private_key = create_key ()
284
+ private_key = (
285
+ generate_key ()
286
+ if path .name .endswith (".key" ) or "pytest" in sys .modules
287
+ else create_key ()
288
+ )
284
289
save_key (private_key , path )
285
290
default_key_path = path .parent / "default.key"
286
291
You can’t perform that action at this time.
0 commit comments