From 874201e442646c020456c394285d9fd0b4578796 Mon Sep 17 00:00:00 2001 From: BobTheBuidler Date: Mon, 18 Nov 2024 01:42:45 +0000 Subject: [PATCH] fix: TypeErrors --- dank_mids/_batch.py | 2 +- dank_mids/_requests.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dank_mids/_batch.py b/dank_mids/_batch.py index 0906b11e..e6fd85f9 100644 --- a/dank_mids/_batch.py +++ b/dank_mids/_batch.py @@ -135,7 +135,7 @@ def coroutines(self) -> Generator[Union["_Batch", Awaitable[RawResponse]], None, yield working_batch working_batch = JSONRPCBatch(self.controller) - rpc_calls_to_batch = self.rpc_calls[:] + rpc_calls_to_batch = list(self.rpc_calls) while rpc_calls_to_batch: if working_batch.is_full: yield working_batch diff --git a/dank_mids/_requests.py b/dank_mids/_requests.py index d877fd0b..69e371e1 100644 --- a/dank_mids/_requests.py +++ b/dank_mids/_requests.py @@ -1074,7 +1074,7 @@ def should_retry(self, e: Exception) -> bool: return self.is_single_multicall @set_done - async def spoof_response(self, response: List[RawResponse], calls: List[RPCRequest]) -> None: + async def spoof_response(self, response: List[RawResponse], calls: Tuple[RPCRequest, ...]) -> None: """ Process the responses from the Ethereum node and set the results for each call. @@ -1091,7 +1091,7 @@ async def spoof_response(self, response: List[RawResponse], calls: List[RPCReque if self.controller._sort_calls: # NOTE: these providers don't always return batch results in the correct ordering # NOTE: is it maybe because they - calls.sort(key=lambda call: call.uid) + calls = sorted(calls, key=lambda call: call.uid) # type: ignore [assignment] if self.controller._sort_response: response.sort(key=lambda raw: raw.decode().id)