kopia lustrzana https://github.com/bugout-dev/moonstream
Black formating.
rodzic
2b646b200a
commit
e7e4ef8916
|
@ -14,7 +14,7 @@ from .models import (
|
|||
XDaiTransaction,
|
||||
WyrmBlock,
|
||||
WyrmLabel,
|
||||
WyrmTransaction
|
||||
WyrmTransaction,
|
||||
)
|
||||
|
||||
from enum import Enum
|
||||
|
@ -37,7 +37,9 @@ def get_block_model(
|
|||
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm
|
||||
set proper blocks model.
|
||||
"""
|
||||
block_model: Type[Union[EthereumBlock, PolygonBlock, MumbaiBlock, XDaiBlock,WyrmBlock]]
|
||||
block_model: Type[
|
||||
Union[EthereumBlock, PolygonBlock, MumbaiBlock, XDaiBlock, WyrmBlock]
|
||||
]
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
block_model = EthereumBlock
|
||||
elif blockchain_type == AvailableBlockchainType.POLYGON:
|
||||
|
@ -61,7 +63,9 @@ def get_label_model(
|
|||
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm
|
||||
set proper block label model.
|
||||
"""
|
||||
label_model: Type[Union[EthereumLabel, PolygonLabel, MumbaiLabel, XDaiLabel, WyrmLabel]]
|
||||
label_model: Type[
|
||||
Union[EthereumLabel, PolygonLabel, MumbaiLabel, XDaiLabel, WyrmLabel]
|
||||
]
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
label_model = EthereumLabel
|
||||
elif blockchain_type == AvailableBlockchainType.POLYGON:
|
||||
|
@ -81,7 +85,13 @@ def get_label_model(
|
|||
def get_transaction_model(
|
||||
blockchain_type: AvailableBlockchainType,
|
||||
) -> Type[
|
||||
Union[EthereumTransaction, PolygonTransaction, MumbaiTransaction, XDaiTransaction, WyrmTransaction]
|
||||
Union[
|
||||
EthereumTransaction,
|
||||
PolygonTransaction,
|
||||
MumbaiTransaction,
|
||||
XDaiTransaction,
|
||||
WyrmTransaction,
|
||||
]
|
||||
]:
|
||||
"""
|
||||
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm
|
||||
|
@ -89,7 +99,11 @@ def get_transaction_model(
|
|||
"""
|
||||
transaction_model: Type[
|
||||
Union[
|
||||
EthereumTransaction, PolygonTransaction, MumbaiTransaction, XDaiTransaction, WyrmTransaction
|
||||
EthereumTransaction,
|
||||
PolygonTransaction,
|
||||
MumbaiTransaction,
|
||||
XDaiTransaction,
|
||||
WyrmTransaction,
|
||||
]
|
||||
]
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
|
|
|
@ -16,7 +16,6 @@ def labels_add_handler(args: argparse.Namespace) -> None:
|
|||
raise ValueError("Unable to parse data as dictionary")
|
||||
|
||||
with yield_db_session_ctx() as db_session:
|
||||
|
||||
label = EthereumLabel(
|
||||
label=args.label, address=str(args.address), label_data=label_data
|
||||
)
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
from enum import Enum
|
||||
from typing import Dict, Union
|
||||
|
||||
|
@ -30,13 +28,14 @@ class Network(Enum):
|
|||
xdai = "xdai"
|
||||
wyrm = "wyrm"
|
||||
|
||||
|
||||
tx_raw_types = Union[
|
||||
EthereumTransaction,
|
||||
MumbaiTransaction,
|
||||
PolygonTransaction,
|
||||
WyrmTransaction,
|
||||
XDaiTransaction
|
||||
]
|
||||
XDaiTransaction,
|
||||
]
|
||||
|
||||
MODELS: Dict[Network, Dict[str, Base]] = {
|
||||
Network.ethereum: {
|
||||
|
|
Ładowanie…
Reference in New Issue