From 5bda09911cfc5b7cce4a1f78fc67cf91f4462b7d Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Sun, 20 Oct 2024 11:03:31 +0200 Subject: [PATCH] Kraken: Fixed weird bug --- fin_depo/data.py | 6 ++++++ fin_depo/defi_kraken.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fin_depo/data.py b/fin_depo/data.py index f82d29a..2a0f228 100644 --- a/fin_depo/data.py +++ b/fin_depo/data.py @@ -44,6 +44,9 @@ class DepoSingle(Depo): _assets: Mapping[Asset, Decimal] + def __post_init__(self): + assert None not in self._assets + def assets(self) -> Iterable[Asset]: return self._assets @@ -58,6 +61,9 @@ class DepoGroup(Depo): nested: list[Depo] + def __post_init__(self): + assert None not in self.nested + def assets(self) -> Iterable[Asset]: assets: set[Asset] = set() for nested_depo in self.nested: diff --git a/fin_depo/defi_kraken.py b/fin_depo/defi_kraken.py index 4e30861..249f799 100644 --- a/fin_depo/defi_kraken.py +++ b/fin_depo/defi_kraken.py @@ -59,4 +59,4 @@ def parse_asset_from_ticker(ticker: str) -> fin_defs.Asset: account = ticker.removesuffix('.HOLD') if account == 'ZEUR': return fin_defs.EUR - asset = fin_defs.WELL_KNOWN_SYMBOLS[account] + return fin_defs.WELL_KNOWN_SYMBOLS[account]