Skip to content

Commit

Permalink
fix: prevent out of list error in extracting data from topics
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 23, 2024
1 parent 8af78d5 commit 322b8b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sentinel/db/contract/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def extract_data_from_topics(abi_record: ABIRecord, topics: List[str]) -> Dict:
if len(topics) != 0:
w3 = Web3()
for input in abi_record.inputs:
if input.indexed:
if input.indexed and len(topics) != 0:
topic_data = HexBytes(topics.pop(0))
kv[input.name] = w3.codec.decode(types=[input.type], data=topic_data)[0]
return kv
Expand Down

0 comments on commit 322b8b8

Please sign in to comment.