diff --git a/app.py b/app.py index b8537d4..9cf6d33 100644 --- a/app.py +++ b/app.py @@ -42,7 +42,7 @@ MAINNET_DATA = [] TESTNET_DATA = [] -SEMANTIC_VERSION_PATTERN = re.compile(r'(v\d+\.\d+\.\d+)') +SEMANTIC_VERSION_PATTERN = re.compile(r'(v\d+(?:\.\d+){0,2})') # Explicit list of chains to pull data from def get_chain_watch_env_var(): @@ -279,6 +279,7 @@ def fetch_data_for_network(network, network_type, repo_path): err_output_data = { "network": network, + "type": network_type, "error": "insufficient data in Cosmos chain registry, consider a PR to cosmos/chain-registry", "upgrade_found": False } @@ -306,13 +307,6 @@ def fetch_data_for_network(network, network_type, repo_path): err_output_data["error"] = f"insufficient data in Cosmos chain registry, no healthy RPC servers for {network}. Consider a PR to cosmos/chain-registry" return err_output_data - if len(healthy_rest_endpoints) == 0: - print(f"No healthy REST endpoints found for network {network} while searching through {len(rest_endpoints)} endpoints. Skipping...") - err_output_data["error"] = f"insufficient data in Cosmos chain registry, no healthy REST servers for {network}. Consider a PR to cosmos/chain-registry" - return err_output_data - - print(f"Found {len(healthy_rest_endpoints)} rest endpoints and {len(healthy_rpc_endpoints)} rpc endpoints for {network}") - # Shuffle the healthy endpoints shuffle(healthy_rpc_endpoints) shuffle(healthy_rest_endpoints) @@ -324,6 +318,15 @@ def fetch_data_for_network(network, network_type, repo_path): rpc_server_used = rpc_endpoint['address'] break + if len(healthy_rest_endpoints) == 0: + print(f"No healthy REST endpoints found for network {network} while searching through {len(rest_endpoints)} endpoints. Skipping...") + err_output_data["error"] = f"insufficient data in Cosmos chain registry, no healthy REST servers for {network}. Consider a PR to cosmos/chain-registry" + err_output_data["latest_block_height"] = latest_block_height + err_output_data["rpc_server"] = rpc_server_used + return err_output_data + + print(f"Found {len(healthy_rest_endpoints)} rest endpoints and {len(healthy_rpc_endpoints)} rpc endpoints for {network}") + # Check for active upgrade proposals upgrade_block_height = None upgrade_name = ""