Skip to content

Commit

Permalink
Add ignore from tests to mev commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JonoPrest committed Nov 19, 2024
1 parent 449b4d1 commit fa4c4fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions codegenerator/cli/src/config_parsing/chain_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use subenum::subenum;

use crate::constants::DEFAULT_CONFIRMED_BLOCK_THRESHOLD;

#[subenum(NetworkWithExplorer, HypersyncNetwork, GraphNetwork)]
#[subenum(NetworkWithExplorer, HypersyncNetwork, GraphNetwork, IgnoreFromTests)]
#[derive(
Clone,
Debug,
Expand Down Expand Up @@ -207,7 +207,7 @@ pub enum Network {
#[subenum(HypersyncNetwork, NetworkWithExplorer)]
Metis = 1088,

#[subenum(HypersyncNetwork)]
#[subenum(IgnoreFromTests)]
MevCommit = 17864,

#[subenum(HypersyncNetwork, NetworkWithExplorer)]
Expand Down
10 changes: 9 additions & 1 deletion codegenerator/cli/src/scripts/print_missing_networks.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use crate::config_parsing::chain_helpers::{GraphNetwork, HypersyncNetwork};
use crate::config_parsing::chain_helpers::{GraphNetwork, HypersyncNetwork, IgnoreFromTests, Network};
use anyhow::Result;
use convert_case::{Case, Casing};
use reqwest;
use serde::Deserialize;
use std::collections::HashSet;
use strum::IntoEnumIterator;

#[derive(Deserialize, Debug)]
struct Chain {
Expand All @@ -20,6 +21,7 @@ pub async fn get_diff() -> Result<Diff> {
let url = "https://chains.hyperquery.xyz/active_chains";
let response = reqwest::get(url).await?;
let chains: Vec<Chain> = response.json().await?;
let ignored_chains = IgnoreFromTests::iter().map(|c|{Network::from(c).get_network_id()}).collect::<Vec<u64>>();

let mut missing_chains = Vec::new();
let mut api_chain_ids = HashSet::new();
Expand All @@ -28,6 +30,9 @@ pub async fn get_diff() -> Result<Diff> {
let Some(chain_id) = chain.chain_id else {
continue;
};
if ignored_chains.contains(&chain_id) {
continue;
}
if chain.name == "internal-test-chain" {
continue;
}
Expand All @@ -51,6 +56,9 @@ pub async fn get_diff() -> Result<Diff> {
let mut extra_chains = Vec::new();
for network in HypersyncNetwork::iter_hypersync_networks() {
let network_id = network as u64;
if !ignored_chains.contains(&network_id) {
continue;
}
if !api_chain_ids.contains(&network_id) {
extra_chains.push(format!("{:?} (ID: {})", network, network_id));
}
Expand Down

0 comments on commit fa4c4fd

Please sign in to comment.