diff --git a/crawlers/mooncrawl/mooncrawl/moonworm_crawler/db.py b/crawlers/mooncrawl/mooncrawl/moonworm_crawler/db.py index 07a8236e..876847dd 100644 --- a/crawlers/mooncrawl/mooncrawl/moonworm_crawler/db.py +++ b/crawlers/mooncrawl/mooncrawl/moonworm_crawler/db.py @@ -120,8 +120,6 @@ def _function_call_to_label( origin_address=function_call.caller_address, ) - print(label) - return label @@ -355,10 +353,10 @@ def add_function_calls_to_session( "transaction_hash": label_function_call.transaction_hash, "log_index": None, "block_number": label_function_call.block_number, - "block_hash": None, + "block_hash": label_function_call.block_hash, "block_timestamp": label_function_call.block_timestamp, - "caller_address": label_function_call.label_data["caller"], - "origin_address": None, + "caller_address": label_function_call.caller_address, + "origin_address": label_function_call.caller_address, "address": label_function_call.address, "label_name": label_function_call.label_name, "label_type": "tx_call", @@ -370,7 +368,7 @@ def add_function_calls_to_session( # Insert records using a single batched query with an ON CONFLICT clause statement = insert(table).values(records) do_nothing_statement = statement.on_conflict_do_nothing( - index_elements=["transaction_hash", "log_index"], + index_elements=["transaction_hash"], index_where=(table.c.label == "seer") & (table.c.label_type == "tx_call"), ) diff --git a/crawlers/mooncrawl/mooncrawl/moonworm_crawler/function_call_crawler.py b/crawlers/mooncrawl/mooncrawl/moonworm_crawler/function_call_crawler.py index f230938e..43f99cec 100644 --- a/crawlers/mooncrawl/mooncrawl/moonworm_crawler/function_call_crawler.py +++ b/crawlers/mooncrawl/mooncrawl/moonworm_crawler/function_call_crawler.py @@ -43,7 +43,6 @@ def _crawl_functions( "function_call", blockchain_type ), ) - print(f"Processing job {function_call_crawler.whitelisted_methods}") function_call_crawler.crawl( from_block, to_block, diff --git a/crawlers/mooncrawl/mooncrawl/moonworm_crawler/historical_crawler.py b/crawlers/mooncrawl/mooncrawl/moonworm_crawler/historical_crawler.py index 1bf931f2..a1013671 100644 --- a/crawlers/mooncrawl/mooncrawl/moonworm_crawler/historical_crawler.py +++ b/crawlers/mooncrawl/mooncrawl/moonworm_crawler/historical_crawler.py @@ -156,11 +156,12 @@ def historical_crawler( db_session, all_function_calls[i : i + max_insert_batch], blockchain_type, + version, ) else: add_function_calls_to_session( - db_session, all_function_calls, blockchain_type + db_session, all_function_calls, blockchain_type, version ) if addresses_deployment_blocks: diff --git a/crawlers/mooncrawl/setup.py b/crawlers/mooncrawl/setup.py index f4d10725..c8d0feaa 100644 --- a/crawlers/mooncrawl/setup.py +++ b/crawlers/mooncrawl/setup.py @@ -38,7 +38,7 @@ setup( "chardet", "fastapi", "moonstreamdb>=0.4.4", - "moonstreamdb-v3>=0.0.9", + "moonstreamdb-v3>=0.1.0", "moonstream-types>=0.0.3", "moonstream>=0.1.1", "moonworm[moonstream]>=0.7.3",