pull/86/head
Yhtyyar Sahatov 2022-08-04 15:47:57 +03:00
rodzic 6e08a54b19
commit a7023e551b
3 zmienionych plików z 11 dodań i 14 usunięć

Wyświetl plik

@ -124,10 +124,10 @@ def handle_watch(args: argparse.Namespace) -> None:
raise ValueError("Please specify --network") raise ValueError("Please specify --network")
network = Network.__members__[args.network] network = Network.__members__[args.network]
from .crawler.networks import yield_db_session_ctx
from .crawler.moonstream_ethereum_state_provider import ( from .crawler.moonstream_ethereum_state_provider import (
MoonstreamEthereumStateProvider, MoonstreamEthereumStateProvider,
) )
from .crawler.networks import yield_db_session_ctx
state_provider = MoonstreamEthereumStateProvider(web3, network) state_provider = MoonstreamEthereumStateProvider(web3, network)

Wyświetl plik

@ -3,23 +3,20 @@ from typing import Any, Dict, List, Optional, Union
from eth_typing.evm import ChecksumAddress from eth_typing.evm import ChecksumAddress
from hexbytes.main import HexBytes from hexbytes.main import HexBytes
from .networks import yield_db_session_ctx
from .networks import (
EthereumLabel,
EthereumTransaction,
PolygonLabel,
PolygonTransaction,
XDaiTransaction,
)
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from sqlalchemy.sql.base import NO_ARG from sqlalchemy.sql.base import NO_ARG
from web3 import Web3 from web3 import Web3
from .ethereum_state_provider import EthereumStateProvider from .ethereum_state_provider import EthereumStateProvider
from .networks import MODELS from .networks import (
MODELS,
EthereumLabel,
EthereumTransaction,
PolygonLabel,
PolygonTransaction,
XDaiTransaction,
yield_db_session_ctx,
)
from .utils import Network from .utils import Network
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)

Wyświetl plik

@ -1,6 +1,7 @@
from typing import Dict from typing import Dict
try: try:
from moonstreamdb.db import yield_db_session_ctx
from moonstreamdb.models import ( from moonstreamdb.models import (
Base, Base,
EthereumBlock, EthereumBlock,
@ -13,7 +14,6 @@ try:
XDaiLabel, XDaiLabel,
XDaiTransaction, XDaiTransaction,
) )
from moonstreamdb.db import yield_db_session_ctx
except ImportError: except ImportError:
print("this feature requires moonstreamdb which is not installed") print("this feature requires moonstreamdb which is not installed")
print("to enable, run: `pip install moonworm[moonstream]`") print("to enable, run: `pip install moonworm[moonstream]`")