From 2ce352e20ee1ddece877d03648f2a61013a52aaa Mon Sep 17 00:00:00 2001 From: Abel Armoa <30988000+aarmoa@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:58:10 -0300 Subject: [PATCH 1/4] (fix) Fixed the logic to get the full path to the ofac.json file --- pyinjective/ofac.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pyinjective/ofac.py b/pyinjective/ofac.py index 75147e97..7a98239b 100644 --- a/pyinjective/ofac.py +++ b/pyinjective/ofac.py @@ -12,20 +12,17 @@ class OfacChecker: def __init__(self): self._ofac_list_path = self.get_ofac_list_path() - if not os.path.exists(self._ofac_list_path): + try: + with open(self._ofac_list_path, "r") as f: + self._ofac_list = set(json.load(f)) + except Exception as e: raise Exception( - "OFAC list is missing on the disk. Please, download it by running python3 pyinjective/ofac_list.py" + f"Error parsing OFAC list. Please, download it by running python3 pyinjective/ofac_list.py ({e})" ) - with open(self._ofac_list_path, "r") as f: - self._ofac_list = set(json.load(f)) - @classmethod def get_ofac_list_path(cls): - current_directory = os.getcwd() - while os.path.basename(current_directory) != "sdk-python": - current_directory = os.path.dirname(current_directory) - return os.path.join(os.path.join(current_directory, "pyinjective"), OFAC_LIST_FILENAME) + return os.path.join(os.path.dirname(__file__), OFAC_LIST_FILENAME) @classmethod async def download_ofac_list(cls): From 090d8b37fe577e0c51c25ae5a49f4d995f441942 Mon Sep 17 00:00:00 2001 From: Abel Armoa <30988000+aarmoa@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:00:03 -0300 Subject: [PATCH 2/4] (fix) Updated CHANGELOG.md file and version in pyproject.toml --- CHANGELOG.md | 6 +++++- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c258871d..43c1fb0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ All notable changes to this project will be documented in this file. -## [1.7.0] - 2024-09-18 +## [1.7.1] - 2024-09-24 +### Fixed +- Fixed logic to get the absolute ofac.json file path + +## [1.7.0] - 2024-09-19 ### Added - Added OFAC restricted addresses validations diff --git a/pyproject.toml b/pyproject.toml index 7846c94a..ad29b263 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "injective-py" -version = "1.7.0" +version = "1.7.1-pre" description = "Injective Python SDK, with Exchange API Client" authors = ["Injective Labs "] license = "Apache-2.0" From ca5b59fd73453569667495f158f87de825097e45 Mon Sep 17 00:00:00 2001 From: Abel Armoa <30988000+aarmoa@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:25:26 -0300 Subject: [PATCH 3/4] (fix) Updated version number in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ad29b263..9f6c5a36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "injective-py" -version = "1.7.1-pre" +version = "1.7.1" description = "Injective Python SDK, with Exchange API Client" authors = ["Injective Labs "] license = "Apache-2.0" From 932388c0134872dbbb5150f61d48673b62d8b591 Mon Sep 17 00:00:00 2001 From: Abel Armoa <30988000+aarmoa@users.noreply.github.com> Date: Tue, 6 Aug 2024 23:36:12 -0300 Subject: [PATCH 4/4] (fix) Change version in pyproject.toml to 1.7.0-pre --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9f6c5a36..c1d24ca9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "injective-py" -version = "1.7.1" +version = "1.8.0-pre" description = "Injective Python SDK, with Exchange API Client" authors = ["Injective Labs "] license = "Apache-2.0"