File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -15,25 +15,25 @@ def middleware(requests_info) -> list:
15
15
# early return if batch to request is empty
16
16
return []
17
17
18
- if self ._w3 .rpc_batch_max_size == 0 or len (requests_info ) == 1 :
19
- # if RPC does not support batch requests or single request in batch, make individual requests
20
- return [
21
- exponential_retry (method )(make_batch_request .__self__ .make_request )(
22
- method ,
23
- params ,
24
- no_retry = not self ._w3 .should_retry
25
- )
26
- for method , params in requests_info
27
- ]
28
-
29
18
if len (requests_info ) > self ._w3 .rpc_batch_max_size :
30
19
response = []
31
20
for start in range (0 , len (requests_info ), self ._w3 .rpc_batch_max_size ):
32
21
response += middleware (requests_info [start :start + self ._w3 .rpc_batch_max_size ])
33
22
return response
34
23
35
24
try :
36
- response = make_batch_request (requests_info )
25
+ if self ._w3 .rpc_batch_max_size == 0 or len (requests_info ) == 1 :
26
+ # if RPC does not support batch requests or single request in batch, make individual requests
27
+ response = [
28
+ exponential_retry (method )(make_batch_request .__self__ .make_request )(
29
+ method ,
30
+ params ,
31
+ no_retry = not self ._w3 .should_retry
32
+ )
33
+ for method , params in requests_info
34
+ ]
35
+ else :
36
+ response = make_batch_request (requests_info )
37
37
except Exception as e :
38
38
assert len (requests_info ) > 1
39
39
print (f"batch RPC call with { len (requests_info )} requests got exception { repr (e )} , splitting and retrying" )
Original file line number Diff line number Diff line change 1
1
from setuptools import setup , find_packages
2
2
3
- VERSION = '0.1.24 '
3
+ VERSION = '0.1.25 '
4
4
DESCRIPTION = 'IceCreamSwap Web3.py wrapper'
5
5
LONG_DESCRIPTION = 'IceCreamSwap Web3.py wrapper with automatic retries, multicall and other advanced functionality'
6
6
You can’t perform that action at this time.
0 commit comments