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:
parent
dd7bec6091
commit
ec835a2935
4 changed files with 19 additions and 15 deletions
|
|
@ -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]:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue