From 71c5e40c9daf74bf149bdb9c3b4b4e70596cb22f Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 20 Apr 2023 22:10:13 -0400 Subject: [PATCH] fix: await methods (#72) --- multicall/call.py | 4 ++-- multicall/multicall.py | 4 ++-- pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/multicall/call.py b/multicall/call.py index d20b1c68..565c87ad 100644 --- a/multicall/call.py +++ b/multicall/call.py @@ -101,8 +101,8 @@ def __call__(self, args: Optional[Any] = None, _w3: Optional[Web3] = None) -> An self.returns, ) - async def __await__(self) -> Any: - return await self.coroutine() + def __await__(self) -> Any: + return self.coroutine().__await__() @eth_retry.auto_retry async def coroutine(self, args: Optional[Any] = None, _w3: Optional[Web3] = None) -> Any: diff --git a/multicall/multicall.py b/multicall/multicall.py index 2a9f19c2..c70abeb6 100644 --- a/multicall/multicall.py +++ b/multicall/multicall.py @@ -59,8 +59,8 @@ def __call__(self) -> Dict[str,Any]: logger.debug(f"Multicall took {time() - start}s") return response - async def __await__(self) -> Dict[str,Any]: - return await self.coroutine() + def __await__(self) -> Dict[str,Any]: + return self.coroutine().__await__() async def coroutine(self) -> Dict[str,Any]: batches = await gather([ diff --git a/pyproject.toml b/pyproject.toml index 9d299323..1f79124e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "multicall" -version = "0.7.2" +version = "0.7.3" description = "aggregate results from multiple ethereum contract calls" authors = ["banteg"]