Skip to content

Commit

Permalink
fix: type error in coin_gecko.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyvan committed Mar 13, 2024
1 parent 39d08a0 commit d9ebff9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion example_publisher/providers/coin_gecko.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ def _update_prices(self) -> None:
)
log.info("updated prices from CoinGecko", prices=self._prices)

def _get_price(self, id: Id) -> float:
def _get_price(self, id: Id) -> Optional[Price]:
return self._prices.get(id, None)

def latest_price(self, symbol: Symbol) -> Optional[Price]:
id = self._symbol_to_id.get(symbol)
if id is None:
return None
return self._get_price(id)

0 comments on commit d9ebff9

Please sign in to comment.