Skip to content

Commit

Permalink
fix: lending (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Aug 15, 2024
1 parent f01f7f2 commit 156c502
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions eth_portfolio/protocols/lending/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

import asyncio
from typing import List, Optional, Union

import a_sync
Expand All @@ -18,10 +17,13 @@
@a_sync.future
@stuck_coro_debugger
async def collateral(address: Address, block: Optional[Block] = None) -> RemoteTokenBalances:
protocols = (protocol for protocol in protocols if isinstance(protocol, LendingProtocolWithLockedCollateral))
return RemoteTokenBalances({
type(protocol).__name__: token_balances
async for protocol, token_balances in a_sync.map(lambda p: p.balances(address, block), protocols)
async for protocol, token_balances
in a_sync.map(
lambda p: p.balances(address, block),
(protocol for protocol in protocols if isinstance(protocol, LendingProtocolWithLockedCollateral)),
)
if token_balances is not None
})

Expand Down

0 comments on commit 156c502

Please sign in to comment.