Better with exception

pull/635/head
kompotkot 2022-06-22 19:01:06 +00:00
rodzic c2b8a55778
commit 3b965522d4
2 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -144,11 +144,14 @@ def continuous_crawler(
if web3 is None:
web3 = _retry_connect_web3(blockchain_type, access_id=access_id)
network = Network.ethereum
if blockchain_type == AvailableBlockchainType.POLYGON:
if blockchain_type == AvailableBlockchainType.ETHEREUM:
network = Network.ethereum
elif blockchain_type == AvailableBlockchainType.POLYGON:
network = Network.polygon
elif blockchain_type == AvailableBlockchainType.XDAI:
network = Network.xdai
else:
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
ethereum_state_provider = MoonstreamEthereumStateProvider(
web3,

Wyświetl plik

@ -71,11 +71,14 @@ def function_call_crawler(
end_block: int,
batch_size: int,
):
network = Network.ethereum
if blockchain_type == AvailableBlockchainType.POLYGON:
if blockchain_type == AvailableBlockchainType.ETHEREUM:
network = Network.ethereum
elif blockchain_type == AvailableBlockchainType.POLYGON:
network = Network.polygon
elif blockchain_type == AvailableBlockchainType.XDAI:
network = Network.xdai
else:
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
ethereum_state_provider = MoonstreamEthereumStateProvider(
web3,