From 3a2b7ebd259af11a5259953e5485a95a1ca6bd13 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Fri, 15 Nov 2024 10:59:13 +0100 Subject: [PATCH] Turns out: The CCXT ids can be literally anything --- fin_defs/__init__.py | 5 ----- test/test_ids.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/fin_defs/__init__.py b/fin_defs/__init__.py index 98afaba..befe4f3 100644 --- a/fin_defs/__init__.py +++ b/fin_defs/__init__.py @@ -268,11 +268,6 @@ class CryptoCurrency(Currency): ccxt_symbol: str coingecko_id: str | None = None - def __post_init__(self) -> None: - if not re.match(r'^\S.*\S$', self.ccxt_symbol): - msg = f'ccxt_symbol was not in correct format: {self.ccxt_symbol}' - raise ValueError(msg) - def raw_short_name(self) -> str: return self.ccxt_symbol diff --git a/test/test_ids.py b/test/test_ids.py index ff67351..df20ab2 100644 --- a/test/test_ids.py +++ b/test/test_ids.py @@ -17,6 +17,7 @@ VALID_IDS = [ 'crypto:LOLCOIN', 'commodity:ALUMINUM', 'unknown:XXX', + 'crypto: ', # CCXT actually found one with only whitespace. Why? ] @@ -41,7 +42,6 @@ INVALID_IDS = [ 'fiat:TEST:TEST', 'index:TEST:TEST', 'commodity:TEST:TEST', - 'crypto: ', '!!!!', '::::', '',