refactor: extract 'bitfinex' and 'BTC/EUR' magic strings to constants

Add SOURCE_BITFINEX and PAIR_BTC_EUR constants in price_fetcher.py and
use them consistently in routes/audit.py, worker.py, and tests.
This commit is contained in:
counterweight 2025-12-22 16:06:56 +01:00
parent dd7bec6091
commit ec835a2935
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
4 changed files with 19 additions and 15 deletions

View file

@ -7,6 +7,10 @@ import httpx
BITFINEX_TICKER_URL = "https://api-pub.bitfinex.com/v2/ticker/tBTCEUR"
LAST_PRICE_INDEX = 6
# Constants for price history records
SOURCE_BITFINEX = "bitfinex"
PAIR_BTC_EUR = "BTC/EUR"
async def fetch_btc_eur_price() -> tuple[float, datetime]:
"""