Skip to content

Commit

Permalink
fix: suppress StopIteration warning (#316)
Browse files Browse the repository at this point in the history
* fix: suppress StopIteration warning

* chore: `black .`

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
BobTheBuidler and github-actions[bot] authored Dec 4, 2024
1 parent eb11e07 commit 25fb784
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dank_mids/_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,11 +721,16 @@ async def get_response(self) -> None: # type: ignore [override]
return await self._exec_single_call()
# elif l < 50: # TODO play with later
# return await JSONRPCBatch(self.controller, self.calls)

# create a strong ref to all calls we will execute so they cant get gced mid execution and mess up response ordering
calls = tuple(self.calls)
if not calls:
# TODO: figure out how we get into this function without any calls
return

rid = self.controller.request_uid.next
demo_logger.info(f"request {rid} for multicall {self.bid} starting") # type: ignore
try:
# create a strong ref to all calls we will execute so they cant get gced mid execution and mess up response ordering
calls = tuple(self.calls)
await self.spoof_response(
await self.controller.make_request(self.method, self.params, request_id=self.uid),
calls,
Expand Down

0 comments on commit 25fb784

Please sign in to comment.