Fixes CoinGecko typos in fiat_convert.py

This commit is contained in:
topscoder 2022-04-01 20:52:16 +02:00 committed by GitHub
parent 0b40c37cc5
commit 7db3c846b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,7 @@ class CryptoToFiatConverter:
except RequestException as request_exception: except RequestException as request_exception:
if "429" in str(request_exception): if "429" in str(request_exception):
logger.warning( logger.warning(
"Too many requests for Coingecko API, backing off and trying again later.") "Too many requests for CoinGecko API, backing off and trying again later.")
# Set backoff timestamp to 60 seconds in the future # Set backoff timestamp to 60 seconds in the future
self._backoff = datetime.datetime.now().timestamp() + 60 self._backoff = datetime.datetime.now().timestamp() + 60
return return
@ -96,7 +96,7 @@ class CryptoToFiatConverter:
if len(found) > 0: if len(found) > 0:
# Wrong! # Wrong!
logger.warning(f"Found multiple mappings in goingekko for {crypto_symbol}.") logger.warning(f"Found multiple mappings in CoinGecko for {crypto_symbol}.")
return None return None
def convert_amount(self, crypto_amount: float, crypto_symbol: str, fiat_symbol: str) -> float: def convert_amount(self, crypto_amount: float, crypto_symbol: str, fiat_symbol: str) -> float:
@ -160,7 +160,7 @@ class CryptoToFiatConverter:
def _find_price(self, crypto_symbol: str, fiat_symbol: str) -> float: def _find_price(self, crypto_symbol: str, fiat_symbol: str) -> float:
""" """
Call CoinGekko API to retrieve the price in the FIAT Call CoinGecko API to retrieve the price in the FIAT
:param crypto_symbol: Crypto-currency you want to convert (e.g btc) :param crypto_symbol: Crypto-currency you want to convert (e.g btc)
:param fiat_symbol: FIAT currency you want to convert to (e.g usd) :param fiat_symbol: FIAT currency you want to convert to (e.g usd)
:return: float, price of the crypto-currency in Fiat :return: float, price of the crypto-currency in Fiat