Skip to content

Commit 91ef2e0

Browse files
committed
v0.1.58 handling batch responses, which are not lists or tuples
1 parent ab3e344 commit 91ef2e0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

IceCreamSwapWeb3/BatchRetryMiddleware.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def request_wrapper(method, params):
5151
except Exception as e:
5252
print(f"batch RPC call with {len(requests_info)} requests got exception {repr(e)}, splitting and retrying")
5353
else:
54-
if len(response) != len(requests_info):
54+
if not (isinstance(response, list) or isinstance(response, tuple)):
55+
print(f"made batch request with size {len(requests_info)} but received malformed response. splitting and retrying. Response: {response}")
56+
elif len(response) != len(requests_info):
5557
print(f"made batch request with size {len(requests_info)} but only received {len(response)} results. splitting and retrying.{f' Sample response: {response[0]}' if len(response) != 0 else ''}")
5658
else:
5759
# find individual failed requests

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup, find_packages
22

3-
VERSION = '0.1.57'
3+
VERSION = '0.1.58'
44
DESCRIPTION = 'IceCreamSwap Web3.py wrapper'
55
LONG_DESCRIPTION = 'IceCreamSwap Web3.py wrapper with automatic retries, multicall and other advanced functionality'
66

0 commit comments

Comments
 (0)