Skip to content

Commit 3044cc2

Browse files
committed
v0.1.17 improved topic to hex conversion for Subsquid crawler
1 parent 074e1fe commit 3044cc2

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

IceCreamSwapWeb3/Subsquid.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,10 @@ def get_filter(
160160
topic: str | list[str]
161161
if isinstance(topics[i], str):
162162
topic = [topics[i]]
163+
elif hasattr(topics[i], "hex"):
164+
topic = [topics[i].hex()]
163165
else:
164-
try:
165-
topic = [single_topic.hex() for single_topic in topics[i]]
166-
except Exception:
167-
topic = [topics[i].hex()]
166+
topic = [(single_topic.hex() if not isinstance(single_topic, str) else single_topic) for single_topic in topics[i]]
168167
query["logs"][0][f"topic{i}"] = topic
169168

170169
logs: list[LogReceipt] = []

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.16'
3+
VERSION = '0.1.17'
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)