File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
- ## [ 1.7.0] - 2024-09-18
5
+ ## [ 1.7.1] - 2024-09-24
6
+ ### Fixed
7
+ - Fixed logic to get the absolute ofac.json file path
8
+
9
+ ## [ 1.7.0] - 2024-09-19
6
10
### Added
7
11
- Added OFAC restricted addresses validations
8
12
Original file line number Diff line number Diff line change 12
12
class OfacChecker :
13
13
def __init__ (self ):
14
14
self ._ofac_list_path = self .get_ofac_list_path ()
15
- if not os .path .exists (self ._ofac_list_path ):
15
+ try :
16
+ with open (self ._ofac_list_path , "r" ) as f :
17
+ self ._ofac_list = set (json .load (f ))
18
+ except Exception as e :
16
19
raise Exception (
17
- "OFAC list is missing on the disk . Please, download it by running python3 pyinjective/ofac_list.py"
20
+ f"Error parsing OFAC list . Please, download it by running python3 pyinjective/ofac_list.py ( { e } ) "
18
21
)
19
22
20
- with open (self ._ofac_list_path , "r" ) as f :
21
- self ._ofac_list = set (json .load (f ))
22
-
23
23
@classmethod
24
24
def get_ofac_list_path (cls ):
25
- current_directory = os .getcwd ()
26
- while os .path .basename (current_directory ) != "sdk-python" :
27
- current_directory = os .path .dirname (current_directory )
28
- return os .path .join (os .path .join (current_directory , "pyinjective" ), OFAC_LIST_FILENAME )
25
+ return os .path .join (os .path .dirname (__file__ ), OFAC_LIST_FILENAME )
29
26
30
27
@classmethod
31
28
async def download_ofac_list (cls ):
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " injective-py"
3
- version = " 1.7.0 "
3
+ version = " 1.7.1 "
4
4
description = " Injective Python SDK, with Exchange API Client"
5
5
authors = [" Injective Labs <contact@injectivelabs.org>" ]
6
6
license = " Apache-2.0"
You can’t perform that action at this time.
0 commit comments