kopia lustrzana https://github.com/bugout-dev/moonworm
isort
rodzic
6e08a54b19
commit
a7023e551b
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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]`")
|
||||||
|
|
Ładowanie…
Reference in New Issue