From 074ce620543395448cc4156e2d077f41e66140eb Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 16 Nov 2022 17:46:08 +0200 Subject: [PATCH 1/3] Fix query. --- crawlers/mooncrawl/mooncrawl/cu_reports_crawler/queries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/queries.py b/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/queries.py index 4f6a07071..679b5bd9b 100644 --- a/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/queries.py +++ b/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/queries.py @@ -210,7 +210,7 @@ select transaction_hash, CASE - WHEN type: ='NFT' THEN 1 + WHEN :type ='NFT' THEN 1 ELSE (label_data->'args'->>'value')::decimal END as value, block_timestamp as block_timestamp From 5dcb760e0555b9dc1bca28cb8245b5e9ec1ff5df Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 16 Nov 2022 19:52:20 +0200 Subject: [PATCH 2/3] Add queries fix. --- .../mooncrawl/mooncrawl/cu_reports_crawler/queries.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/queries.py b/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/queries.py index 679b5bd9b..d771adc42 100644 --- a/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/queries.py +++ b/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/queries.py @@ -229,7 +229,7 @@ sum(all_transfers.value) as value, sum( CASE - WHEN to_address in ('0xF715bEb51EC8F63317d66f491E37e7BB048fCc2d','0xfede379e48C873C75F3cc0C81F7C784aD730a8F7','0x00000000006c3852cbef3e08e8df289169ede581') + WHEN to_address in ('0xF715bEb51EC8F63317d66f491E37e7BB048fCc2d','0xfede379e48C873C75F3cc0C81F7C784aD730a8F7','0x00000000006c3852cbEf3e08E8dF289169EdE581') THEN 1 else 0 END @@ -241,7 +241,7 @@ sum(after_range_transfer.value) as value, sum( CASE - WHEN to_address in ('0xF715bEb51EC8F63317d66f491E37e7BB048fCc2d','0xfede379e48C873C75F3cc0C81F7C784aD730a8F7','0x00000000006c3852cbef3e08e8df289169ede581') + WHEN to_address in ('0xF715bEb51EC8F63317d66f491E37e7BB048fCc2d','0xfede379e48C873C75F3cc0C81F7C784aD730a8F7','0x00000000006c3852cbEf3e08E8dF289169EdE581') THEN 1 else 0 END @@ -281,7 +281,7 @@ sum(interval_transfers.value) as value, sum( CASE - WHEN to_address in ('0xF715bEb51EC8F63317d66f491E37e7BB048fCc2d','0xfede379e48C873C75F3cc0C81F7C784aD730a8F7','0x00000000006c3852cbef3e08e8df289169ede581') + WHEN to_address in ('0xF715bEb51EC8F63317d66f491E37e7BB048fCc2d','0xfede379e48C873C75F3cc0C81F7C784aD730a8F7','0x00000000006c3852cbEf3e08E8dF289169EdE581') THEN 1 else 0 END @@ -334,7 +334,7 @@ sum(nfts_data.value) as value, sum( CASE - WHEN to_address in ('0xF715bEb51EC8F63317d66f491E37e7BB048fCc2d','0xfede379e48C873C75F3cc0C81F7C784aD730a8F7','0x00000000006c3852cbef3e08e8df289169ede581') + WHEN to_address in ('0xF715bEb51EC8F63317d66f491E37e7BB048fCc2d','0xfede379e48C873C75F3cc0C81F7C784aD730a8F7','0x00000000006c3852cbEf3e08E8dF289169EdE581') THEN 1 else 0 END @@ -372,7 +372,7 @@ contract_erc721_transfers.seller as seller from polygon_transactions inner JOIN contract_erc721_transfers ON contract_erc721_transfers.transaction_hash = polygon_transactions.hash - where polygon_transactions.to_address in ('0xF715bEb51EC8F63317d66f491E37e7BB048fCc2d','0xfede379e48C873C75F3cc0C81F7C784aD730a8F7', '0x00000000006c3852cbef3e08e8df289169ede581') + where polygon_transactions.to_address in ('0xF715bEb51EC8F63317d66f491E37e7BB048fCc2d','0xfede379e48C873C75F3cc0C81F7C784aD730a8F7', '0x00000000006c3852cbEf3e08E8dF289169EdE581') limit :amount """, }, From 747a36db5ad29c2d4bb1501cc4001d4230583126 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 16 Nov 2022 20:48:05 +0200 Subject: [PATCH 3/3] Fix logger. --- crawlers/mooncrawl/mooncrawl/cu_reports_crawler/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/cli.py b/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/cli.py index 04b70db0a..b5e45a0ab 100644 --- a/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/cli.py +++ b/crawlers/mooncrawl/mooncrawl/cu_reports_crawler/cli.py @@ -459,7 +459,7 @@ def list_user_queries_handler(args: argparse.Namespace): ) for query in queries.queries: - logger.info(query.name, query.id) + logger.info(f"{query.name}: {query.id}") def delete_user_query_handler(args: argparse.Namespace):