From d7d2e3614e6238789dfb6668b0c0ffc1fb886e3c Mon Sep 17 00:00:00 2001 From: Paulo Antunes Date: Sun, 6 Dec 2020 21:29:20 +0100 Subject: [PATCH] Bumped version to v0.8.3 --- CHANGELOG.md | 2 +- xtcryptosignals/__init__.py | 2 +- xtcryptosignals/tasks/schemas/base.py | 8 ++------ xtcryptosignals/tasks/settings.py | 3 +++ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3cfb62d..20d27f29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog All changes will be registered here per release. -## [0.8.3] - Current date +## [0.8.3] - 2020-12-06 Added Coins/Tokens page. Added feature to list/show/mark Coins/Tokens as Favourites. Changed from `LEND` to `AAVE` Token. diff --git a/xtcryptosignals/__init__.py b/xtcryptosignals/__init__.py index 641b8265..cd23789e 100644 --- a/xtcryptosignals/__init__.py +++ b/xtcryptosignals/__init__.py @@ -9,4 +9,4 @@ __maintainer__ = "Paulo Antunes" __email__ = "pjmlantunes@gmail.com" -__version__ = "0.8.3rc" +__version__ = "0.8.3" diff --git a/xtcryptosignals/tasks/schemas/base.py b/xtcryptosignals/tasks/schemas/base.py index cdd53fa3..4e9d0b62 100644 --- a/xtcryptosignals/tasks/schemas/base.py +++ b/xtcryptosignals/tasks/schemas/base.py @@ -23,7 +23,7 @@ class BaseSchema(Schema): def post_load(self, data): data_symbol = data["symbol"][-3:] - if data_symbol in ("ETH", "BTC"): + if data_symbol in s.COIN_OR_TOKEN_REFERENCE[:2]: key = s.REDIS_KEY_TICKER.format( source=s.BINANCE, symbol=data_symbol + "USDT", @@ -35,9 +35,5 @@ def post_load(self, data): deser_row = json.loads(ser_row) price = deser_row["price"] data["price_usdt"] = data["price"] * float(price) - elif data_symbol == "DAI": - data["price_usdt"] = data["price"] - elif data_symbol == "USD": - data["price_usdt"] = data["price"] - elif data["symbol"][-4:] == "USDT": + elif data_symbol in s.COIN_OR_TOKEN_REFERENCE[2:]: data["price_usdt"] = data["price"] diff --git a/xtcryptosignals/tasks/settings.py b/xtcryptosignals/tasks/settings.py index d5d1d151..5d001a0f 100644 --- a/xtcryptosignals/tasks/settings.py +++ b/xtcryptosignals/tasks/settings.py @@ -45,6 +45,9 @@ STATIC_COINS_TOKENS_LOGOS_FOLDER = "/static/imgs/logos/" +# order matters in class BaseSchema +COIN_OR_TOKEN_REFERENCE = ("ETH", "BTC", "DAI", "USD", "USDT",) + from xtcryptosignals.settings import * # noqa from xtcryptosignals.tasks.settings_local import * # noqa