Skip to content

Commit

Permalink
add duplicate logs warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommel71 committed Dec 18, 2023
1 parent a712208 commit 73ec797
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/graphsenselib/ingest/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,19 @@ def prepare_logs_inplace(items: Iterable, block_bucket_size: int):

item["topics"] = [hex_to_bytearray(t) for t in tpcs]

# if topics contain duplicates
if (
len(item["topics"]) % 2 == 0
): # todo may be removed if we are that there are no duplicates
if (
item["topics"][: len(item["topics"]) // 2]
== item["topics"][len(item["topics"]) // 2 :]
):
logger.warning(
f"duplicate found; hash: {item['tx_hash']};"
f" topics: {item['topics']}"
)

if "transaction_hash" in item:
item.pop("transaction_hash")

Expand Down

0 comments on commit 73ec797

Please sign in to comment.