Imx zkevm with it's sepolia types

pull/1112/head
kompotkot 2024-07-25 14:55:17 +00:00
rodzic f40a0779da
commit 3b4fee53cf
4 zmienionych plików z 39 dodań i 1 usunięć

Wyświetl plik

@ -79,6 +79,8 @@ from moonstreamdbv3.models import EthereumLabel as EthereumLabelV3
from moonstreamdbv3.models import (
Game7OrbitArbitrumSepoliaLabel as Game7OrbitArbitrumSepoliaLabelV3,
)
from moonstreamdbv3.models import ImxZkevmLabel as ImxZkevmLabelV3
from moonstreamdbv3.models import ImxZkevmSepoliaLabel as ImxZkevmSepoliaLabelV3
from moonstreamdbv3.models import MantleLabel as MantleLabelV3
from moonstreamdbv3.models import MantleSepoliaLabel as MantleSepoliaLabelV3
from moonstreamdbv3.models import MumbaiLabel as MumbaiLabelV3
@ -121,6 +123,8 @@ class AvailableBlockchainType(Enum):
STARKNET_SEPOLIA = "starknet_sepolia"
MANTLE = "mantle"
MANTLE_SEPOLIA = "mantle_sepolia"
IMX_ZKEVM = "imx_zkevm"
IMX_ZKEVM_SEPOLIA = "imx_zkevm_sepolia"
def get_block_model(
@ -276,6 +280,8 @@ def get_label_model(
StarknetSepoliaLabelV3,
MantleLabelV3,
MantleSepoliaLabelV3,
ImxZkevmLabelV3,
ImxZkevmSepoliaLabelV3,
]
]:
"""
@ -332,6 +338,8 @@ def get_label_model(
StarknetSepoliaLabelV3,
MantleLabelV3,
MantleSepoliaLabelV3,
ImxZkevmLabelV3,
ImxZkevmSepoliaLabelV3,
]
]
if version == 2:
@ -428,6 +436,10 @@ def get_label_model(
label_model = MantleLabelV3
elif blockchain_type == AvailableBlockchainType.MANTLE_SEPOLIA:
label_model = MantleSepoliaLabelV3
elif blockchain_type == AvailableBlockchainType.IMX_ZKEVM:
label_model = ImxZkevmLabelV3
elif blockchain_type == AvailableBlockchainType.IMX_ZKEVM_SEPOLIA:
label_model = ImxZkevmSepoliaLabelV3
else:
raise Exception("Unsupported blockchain type provided")
else:

Wyświetl plik

@ -80,6 +80,8 @@ from moonstreamdbv3.models import EthereumLabel as EthereumLabelV3
from moonstreamdbv3.models import (
Game7OrbitArbitrumSepoliaLabel as Game7OrbitArbitrumSepoliaLabelV3,
)
from moonstreamdbv3.models import ImxZkevmLabel as ImxZkevmLabelV3
from moonstreamdbv3.models import ImxZkevmSepoliaLabel as ImxZkevmSepoliaLabelV3
from moonstreamdbv3.models import MantleLabel as MantleLabelV3
from moonstreamdbv3.models import MantleSepoliaLabel as MantleSepoliaLabelV3
from moonstreamdbv3.models import MumbaiLabel as MumbaiLabelV3
@ -124,6 +126,8 @@ class Network(Enum):
starknet_sepolia = "starknet_sepolia"
mantle = "mantle"
mantle_sepolia = "mantle_sepolia"
imx_zkevm = "imx_zkevm"
imx_zkevm_sepolia = "imx_zkevm_sepolia"
tx_raw_types = Union[
@ -331,6 +335,12 @@ MODELS_V3: Dict[Network, Dict[str, Base]] = {
Network.mantle_sepolia: {
"labels": MantleSepoliaLabelV3,
},
Network.imx_zkevm: {
"labels": ImxZkevmLabelV3,
},
Network.imx_zkevm_sepolia: {
"labels": ImxZkevmSepoliaLabelV3,
},
}
@ -390,5 +400,9 @@ def blockchain_type_to_network_type(
return Network.mantle
elif blockchain_type == AvailableBlockchainType.MANTLE_SEPOLIA:
return Network.mantle_sepolia
elif blockchain_type == AvailableBlockchainType.IMX_ZKEVM:
return Network.imx_zkevm
elif blockchain_type == AvailableBlockchainType.IMX_ZKEVM_SEPOLIA:
return Network.imx_zkevm_sepolia
else:
raise ValueError(f"Unknown blockchain type: {blockchain_type}")

Wyświetl plik

@ -32,6 +32,8 @@ class SubscriptionTypes(Enum):
STARKNET_SEPOLIA_BLOCKCHAIN = "starknet_sepolia_smartcontract"
MANTLE_BLOCKCHAIN = "mantle_smartcontract"
MANTLE_SEPOLIA_BLOCKCHAIN = "mantle_sepolia_smartcontract"
IMX_ZKEVM_BLOCKCHAIN = "imx_zkevm_smartcontract"
IMX_ZKEVM_SEPOLIA_BLOCKCHAIN = "imx_zkevm_sepolia_smartcontract"
def blockchain_type_to_subscription_type(
@ -89,6 +91,10 @@ def blockchain_type_to_subscription_type(
return SubscriptionTypes.MANTLE_BLOCKCHAIN
elif blockchain_type == AvailableBlockchainType.MANTLE_SEPOLIA:
return SubscriptionTypes.MANTLE_SEPOLIA_BLOCKCHAIN
elif blockchain_type == AvailableBlockchainType.IMX_ZKEVM:
return SubscriptionTypes.IMX_ZKEVM_BLOCKCHAIN
elif blockchain_type == AvailableBlockchainType.IMX_ZKEVM_SEPOLIA:
return SubscriptionTypes.IMX_ZKEVM_SEPOLIA_BLOCKCHAIN
else:
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
@ -120,6 +126,8 @@ subscription_id_by_blockchain = {
"starknet_sepolia": "starknet_sepolia_smartcontract",
"mantle": "mantle_smartcontract",
"mantle_sepolia": "mantle_sepolia_smartcontract",
"imx_zkevm": "imx_zkevm_smartcontract",
"imx_zkevm_sepolia": "imx_zkevm_sepolia_smartcontract",
}
blockchain_by_subscription_id = {
@ -149,6 +157,8 @@ blockchain_by_subscription_id = {
"starknet_sepolia_blockchain": "starknet_sepolia",
"mantle_blockchain": "mantle",
"mantle_sepolia_blockchain": "mantle_sepolia",
"imx_zkevm_blockchain": "imx_zkevm",
"imx_zkevm_sepolia_blockchain": "imx_zkevm_sepolia",
"ethereum_smartcontract": "ethereum",
"polygon_smartcontract": "polygon",
"mumbai_smartcontract": "mumbai",
@ -174,4 +184,6 @@ blockchain_by_subscription_id = {
"starknet_sepolia_smartcontract": "starknet_sepolia",
"mantle_smartcontract": "mantle",
"mantle_sepolia_smartcontract": "mantle_sepolia",
"imx_zkevm_smartcontract": "imx_zkevm",
"imx_zkevm_sepolia_smartcontract": "imx_zkevm_sepolia",
}

Wyświetl plik

@ -34,7 +34,7 @@ setup(
zip_safe=False,
install_requires=[
"moonstreamdb>=0.4.5",
"moonstreamdb-v3>=0.0.9",
"moonstreamdb-v3>=0.0.15",
],
extras_require={
"dev": ["black", "isort", "mypy"],