From 7ccc9c5d618e1e04232d79dbdb6cb73aac8dc3b6 Mon Sep 17 00:00:00 2001 From: frank <98238480+soundsonacid@users.noreply.github.com> Date: Tue, 27 Feb 2024 09:49:36 -0600 Subject: [PATCH] frank/0.7.28 (#115) * fix mm unsub bug * bump version --- .bumpversion.cfg | 2 +- CHANGELOG.md | 6 +++++- pyproject.toml | 2 +- src/driftpy/__init__.py | 2 +- src/driftpy/market_map/market_map.py | 5 +++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b0d284c2..951f2bfb 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.7.27 +current_version = 0.7.28 commit = True tag = True tag_name = {new_version} diff --git a/CHANGELOG.md b/CHANGELOG.md index ffe0e5f8..0ab4bf48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -144,4 +144,8 @@ Fix bug in `decode_user()` where `remainder_base_amount` would decode incorrectl ## [0.7.26] - 2024-2-26 -Filter out logs with errors in `websocket_log_provider.py` to avoid `EventSubscriber` returning false positive events \ No newline at end of file +Filter out logs with errors in `websocket_log_provider.py` to avoid `EventSubscriber` returning false positive events + +## [0.7.27] - 2024-2-27 + +Fix bug where `MarketMap.unsubscribe()` wasn't properly awaited \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e1f28866..0450dd05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "driftpy" -version = "0.7.27" +version = "0.7.28" description = "A Python client for the Drift DEX" authors = ["x19 ", "bigz ", "frank "] license = "MIT" diff --git a/src/driftpy/__init__.py b/src/driftpy/__init__.py index 3b7d3763..ef628c19 100644 --- a/src/driftpy/__init__.py +++ b/src/driftpy/__init__.py @@ -1 +1 @@ -__version__ = "0.7.27" +__version__ = "0.7.28" diff --git a/src/driftpy/market_map/market_map.py b/src/driftpy/market_map/market_map.py index d0b19fa6..6a0ed7e4 100644 --- a/src/driftpy/market_map/market_map.py +++ b/src/driftpy/market_map/market_map.py @@ -53,8 +53,9 @@ async def subscribe(self): await self.subscription.subscribe() self.is_subscribed = True - async def unsubscribe(self): - await self.subscription.unsubscribe() + def unsubscribe(self): + loop = asyncio.get_event_loop() + loop.run_until_complete(self.subscription.unsubscribe()) for key in list(self.market_map.keys()): del self.market_map[key]