Skip to content

Commit f50cb35

Browse files
committed
v0.1.61 preventing invalid parsing of some RPC errors as ContractLogicError's
1 parent 2c38b9c commit f50cb35

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

IceCreamSwapWeb3/Web3ErrorHandlerPatch.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,9 @@ def raise_contract_logic_error_on_revert(response: RPCResponse) -> RPCResponse:
103103

104104
message = error.get("message")
105105
message_present = message is not None and message != ""
106-
data = error.get("data")
107-
108-
if data is None:
109-
if message_present:
110-
raise ContractLogicError(message, data=MISSING_DATA)
111-
elif not message_present:
112-
raise ContractLogicError("execution reverted", data=MISSING_DATA)
113-
elif isinstance(data, dict) and message_present:
106+
data = error.get("data", MISSING_DATA)
107+
108+
if isinstance(data, dict) and message_present:
114109
raise ContractLogicError(f"execution reverted: {message}", data=data)
115110
elif isinstance(data, str):
116111
_raise_contract_error(data)

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.60'
3+
VERSION = '0.1.61'
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)