Skip to content

Commit

Permalink
fix: some block range reverting in maker module
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Nov 19, 2024
1 parent 9d8a9f9 commit 87ff31b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion eth_portfolio/protocols/lending/maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import List, Optional

from async_lru import alru_cache
from dank_mids.exceptions import Revert
from eth_typing import HexStr
from y import Contract, Network, contract_creation_block_async, get_price
from y._decorators import stuck_coro_debugger
Expand Down Expand Up @@ -80,7 +81,10 @@ async def _debt(self, address: Address, block: Optional[int] = None) -> TokenBal

async def get_ilks(self, block: Optional[int]) -> List[HexStr]:
"""List all ilks (cdp keys of sorts) for MakerDAO"""
return await self.ilk_registry.list.coroutine(block_identifier=block)
try:
return await self.ilk_registry.list.coroutine(block_identifier=block)
except Revert:
return []

@alru_cache
async def get_gem(self, ilk: bytes) -> str:
Expand Down

0 comments on commit 87ff31b

Please sign in to comment.