From 73ec797782385fb4cb6ac32a36e6b4a50e2214ea Mon Sep 17 00:00:00 2001 From: Thomas Niedermayer Date: Mon, 18 Dec 2023 17:07:00 +0100 Subject: [PATCH] add duplicate logs warning --- src/graphsenselib/ingest/account.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/graphsenselib/ingest/account.py b/src/graphsenselib/ingest/account.py index 9967931..e8f9506 100644 --- a/src/graphsenselib/ingest/account.py +++ b/src/graphsenselib/ingest/account.py @@ -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")