Skip to content

Commit f133165

Browse files
committed
v0.1.59 Retrying multicall till it succeeds. Likely need to exempt some more exceptions to avoid infinite retry loops
1 parent 91ef2e0 commit f133165

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

IceCreamSwapWeb3/Multicall.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from web3.exceptions import ContractLogicError
1111
from web3.types import StateOverride
1212

13+
from IceCreamSwapWeb3.EthAdvanced import exponential_retry
1314
from .AddressCalculator import calculate_create_address
1415
from .FastChecksumAddress import to_checksum_address
1516

@@ -175,10 +176,11 @@ def _inner_call(
175176
except Exception as e:
176177
if len(calls_with_calldata) == 1:
177178
try:
178-
raw_returns, gas_usages = self._call_multicall(
179+
exponential_retry(func_name="multicall")(func=self._call_multicall)(
179180
multicall_call=multicall_call,
180181
use_revert=use_revert,
181-
retry=True,
182+
retry=self.w3.should_retry,
183+
no_retry=not self.w3.should_retry,
182184
state_override=state_override,
183185
block_identifier=block_identifier
184186
)

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.58'
3+
VERSION = '0.1.59'
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)