pull/1097/head
Andrey 2024-06-21 13:48:49 +03:00
rodzic ece1159837
commit 10e0a410d7
9 zmienionych plików z 16 dodań i 18 usunięć

Wyświetl plik

@ -15,7 +15,7 @@ from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import Query, Session from sqlalchemy.orm import Query, Session
from tqdm import tqdm from tqdm import tqdm
from web3 import HTTPProvider, IPCProvider, Web3 from web3 import HTTPProvider, IPCProvider, Web3
from web3.middleware import geth_poa_middleware from web3.middleware import geth_poa_middleware # type: ignore
from web3.types import BlockData from web3.types import BlockData
from .data import DateRange from .data import DateRange

Wyświetl plik

@ -14,7 +14,7 @@ from moonstreamdbv3.db import (
from moonstreamtypes.blockchain import AvailableBlockchainType from moonstreamtypes.blockchain import AvailableBlockchainType
from moonstreamtypes.subscriptions import blockchain_type_to_subscription_type from moonstreamtypes.subscriptions import blockchain_type_to_subscription_type
from web3 import Web3 from web3 import Web3
from web3.middleware import geth_poa_middleware from web3.middleware import geth_poa_middleware # type: ignore
from ..db import yield_db_session_ctx from ..db import yield_db_session_ctx
from ..settings import ( from ..settings import (
@ -435,9 +435,9 @@ def handle_historical_crawl(args: argparse.Namespace) -> None:
if args.find_deployed_blocks: if args.find_deployed_blocks:
addresses_set = set() addresses_set = set()
for job in filtered_event_jobs: for job in filtered_event_jobs:
addresses_set.update(job.contracts) addresses_set.update(job.contracts) # type: ignore
for function_job in filtered_function_call_jobs: for function_job in filtered_function_call_jobs:
addresses_set.add(function_job.contract_address) addresses_set.add(function_job.contract_address) # type: ignore
if args.start is None: if args.start is None:
start_block = web3.eth.blockNumber - 1 start_block = web3.eth.blockNumber - 1
@ -488,8 +488,8 @@ def handle_historical_crawl(args: argparse.Namespace) -> None:
db_session, db_session,
blockchain_type, blockchain_type,
web3, web3,
filtered_event_jobs, filtered_event_jobs, # type: ignore
filtered_function_call_jobs, filtered_function_call_jobs, # type: ignore
start_block, start_block,
end_block, end_block,
args.max_blocks_batch, args.max_blocks_batch,

Wyświetl plik

@ -22,7 +22,7 @@ def _event_to_label(
event: Event, event: Event,
label_name=CRAWLER_LABEL, label_name=CRAWLER_LABEL,
db_version: int = 2, db_version: int = 2,
) -> Base: ) -> Base: # type: ignore
""" """
Creates a label model. Creates a label model.
""" """
@ -72,7 +72,7 @@ def _function_call_to_label(
function_call: ContractFunctionCall, function_call: ContractFunctionCall,
db_version: int = 2, db_version: int = 2,
label_name=CRAWLER_LABEL, label_name=CRAWLER_LABEL,
) -> Base: ) -> Base: # type: ignore
""" """
Creates a label model. Creates a label model.
""" """

Wyświetl plik

@ -8,10 +8,10 @@ from moonstreamtypes.blockchain import (
get_label_model, get_label_model,
get_block_model, get_block_model,
) )
from moonworm.crawler.log_scanner import ( from moonworm.crawler.log_scanner import ( # type: ignore
_crawl_events as moonworm_autoscale_crawl_events, # type: ignore _crawl_events as moonworm_autoscale_crawl_events,
) )
from moonworm.crawler.log_scanner import _fetch_events_chunk from moonworm.crawler.log_scanner import _fetch_events_chunk # type: ignore
from sqlalchemy.orm.session import Session from sqlalchemy.orm.session import Session
from sqlalchemy.sql.expression import and_ from sqlalchemy.sql.expression import and_
from web3 import Web3 from web3 import Web3

Wyświetl plik

@ -1,7 +1,6 @@
import logging import logging
from typing import List, Union from typing import List, Union
from moonstreamdb.blockchain import AvailableBlockchainType
from moonstreamtypes.blockchain import AvailableBlockchainType from moonstreamtypes.blockchain import AvailableBlockchainType
from moonstreamdb.networks import blockchain_type_to_network_type # type: ignore from moonstreamdb.networks import blockchain_type_to_network_type # type: ignore
from moonworm.crawler.function_call_crawler import ( # type: ignore from moonworm.crawler.function_call_crawler import ( # type: ignore
@ -11,7 +10,7 @@ from moonworm.crawler.function_call_crawler import ( # type: ignore
from moonworm.crawler.moonstream_ethereum_state_provider import ( # type: ignore from moonworm.crawler.moonstream_ethereum_state_provider import ( # type: ignore
MoonstreamEthereumStateProvider, MoonstreamEthereumStateProvider,
) )
from moonworm.crawler.ethereum_state_provider import Web3StateProvider from moonworm.crawler.ethereum_state_provider import Web3StateProvider # type: ignore
from moonworm.watch import MockState # type: ignore from moonworm.watch import MockState # type: ignore
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from web3 import Web3 from web3 import Web3

Wyświetl plik

@ -11,7 +11,7 @@ from moonworm.crawler.moonstream_ethereum_state_provider import ( # type: ignor
MoonstreamEthereumStateProvider, MoonstreamEthereumStateProvider,
Network, Network,
) )
from moonworm.crawler.ethereum_state_provider import Web3StateProvider from moonworm.crawler.ethereum_state_provider import Web3StateProvider # type: ignore
from sqlalchemy.orm.session import Session from sqlalchemy.orm.session import Session
from web3 import Web3 from web3 import Web3

Wyświetl plik

@ -3,7 +3,7 @@ from typing import Dict, Optional
from uuid import UUID from uuid import UUID
from bugout.app import Bugout from bugout.app import Bugout
from moonstreamdb.blockchain import AvailableBlockchainType from moonstreamtypes.blockchain import AvailableBlockchainType
# Bugout # Bugout
BUGOUT_BROOD_URL = os.environ.get("BUGOUT_BROOD_URL", "https://auth.bugout.dev") BUGOUT_BROOD_URL = os.environ.get("BUGOUT_BROOD_URL", "https://auth.bugout.dev")

Wyświetl plik

@ -11,8 +11,7 @@ from typing import Any, Dict, List, Optional
from uuid import UUID from uuid import UUID
from moonstream.client import Moonstream # type: ignore from moonstream.client import Moonstream # type: ignore
from moonstreamdb.blockchain import AvailableBlockchainType from moonstreamtypes.blockchain import AvailableBlockchainType
from web3.middleware import geth_poa_middleware
from mooncrawl.moonworm_crawler.crawler import _retry_connect_web3 from mooncrawl.moonworm_crawler.crawler import _retry_connect_web3

Wyświetl plik

@ -2,7 +2,7 @@ import json
import logging import logging
from typing import Any, Dict from typing import Any, Dict
from moonstreamdb.blockchain import AvailableBlockchainType, get_label_model from moonstreamtypes.blockchain import AvailableBlockchainType, get_label_model
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from ..settings import VIEW_STATE_CRAWLER_LABEL from ..settings import VIEW_STATE_CRAWLER_LABEL