From 131e7b87304beee44d971f69eaf7feb55094982f Mon Sep 17 00:00:00 2001 From: Jono Prest <65739024+JonoPrest@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:57:23 +0200 Subject: [PATCH] Update chain tiers (#386) * Make celo and opbnbn tiers experimental * Run formatter --- .../cli/src/config_parsing/chain_helpers.rs | 5 +- .../cli/src/config_parsing/human_config.rs | 12 ++- .../cli/src/config_parsing/system_config.rs | 102 ++++++++++-------- 3 files changed, 67 insertions(+), 52 deletions(-) diff --git a/codegenerator/cli/src/config_parsing/chain_helpers.rs b/codegenerator/cli/src/config_parsing/chain_helpers.rs index 8e0b57f36..ccfdf7099 100644 --- a/codegenerator/cli/src/config_parsing/chain_helpers.rs +++ b/codegenerator/cli/src/config_parsing/chain_helpers.rs @@ -503,14 +503,13 @@ impl HypersyncNetwork { Manta | Base | BerachainBartio | Boba | Blast | Cyber | Aurora | Harmony | Scroll | Darwinia | Mode | Rsk | ShimmerEvm | Linea | NeonEvm | Amoy | Saakuru | Moonbeam - | Opbnb | Lisk | BlastSepolia | Celo | Chiliz | Fuji | ArbitrumOne | Merlin - | Holesky => Silver, + | Lisk | BlastSepolia | Chiliz | Fuji | ArbitrumOne | Merlin | Holesky => Silver, Zora | MoonbaseAlpha | Morph | LuksoTestnet | Kroma | GnosisChiado | Lukso | Gnosis | C1Milkomeda | Crab | Sophon | Flare | PolygonZkevm | MevCommit | Tangle => Bronze, SophonTestnet | MorphTestnet | GaladrielDevnet | CitreaTestnet | Goerli - | BscTestnet | UnichainSepolia | Zircuit => Experimental, + | BscTestnet | UnichainSepolia | Zircuit | Celo | Opbnb => Experimental, } } diff --git a/codegenerator/cli/src/config_parsing/human_config.rs b/codegenerator/cli/src/config_parsing/human_config.rs index f0876d7ad..55c508f31 100644 --- a/codegenerator/cli/src/config_parsing/human_config.rs +++ b/codegenerator/cli/src/config_parsing/human_config.rs @@ -179,7 +179,8 @@ pub mod evm { pub save_full_history: Option, #[serde(skip_serializing_if = "Option::is_none")] #[schemars( - description = "Select the block and transaction fields to include in all events globally" + description = "Select the block and transaction fields to include in all events \ + globally" )] pub field_selection: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -206,11 +207,13 @@ pub mod evm { #[serde(deny_unknown_fields)] pub struct FieldSelection { #[schemars( - description = "The transaction fields to include in the event, or in all events if applied globally" + description = "The transaction fields to include in the event, or in all events if \ + applied globally" )] pub transaction_fields: Option>, #[schemars( - description = "The block fields to include in the event, or in all events if applied globally" + description = "The block fields to include in the event, or in all events if applied \ + globally" )] pub block_fields: Option>, } @@ -445,7 +448,8 @@ pub mod evm { pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] #[schemars( - description = "Select the block and transaction fields to include in the specific event" + description = "Select the block and transaction fields to include in the specific \ + event" )] pub field_selection: Option, } diff --git a/codegenerator/cli/src/config_parsing/system_config.rs b/codegenerator/cli/src/config_parsing/system_config.rs index e442fbf2c..b40623717 100644 --- a/codegenerator/cli/src/config_parsing/system_config.rs +++ b/codegenerator/cli/src/config_parsing/system_config.rs @@ -80,9 +80,12 @@ impl EnvState { } Err(err) => { match err { - dotenvy::Error::Io(_, _) => (), - _ => println!("Warning: Failed loading .env file with unexpected error: {err}"), - }; + dotenvy::Error::Io(_, _) => (), + _ => println!( + "Warning: Failed loading .env file with unexpected error: \ + {err}" + ), + }; self.maybe_dotenv = Some(EnvMap::new()); Err(err) } @@ -185,16 +188,18 @@ mod interpolation { if !invalid_vars.is_empty() { return Err(anyhow!( - "Failed to interpolate variables into your config file. Invalid environment variables are present: {}", - invalid_vars.join(", ") - )); + "Failed to interpolate variables into your config file. Invalid environment \ + variables are present: {}", + invalid_vars.join(", ") + )); } if !missing_vars.is_empty() { return Err(anyhow!( - "Failed to interpolate variables into your config file. Environment variables are not present: {}", - missing_vars.join(", ") - )); + "Failed to interpolate variables into your config file. Environment variables are \ + not present: {}", + missing_vars.join(", ") + )); } Ok(config_string.to_string()) @@ -544,9 +549,10 @@ impl SystemConfig { has_rpc_sync_src, ) .context(format!( - "Failed parsing abi types for events in contract {} on network {}", - contract.name, network.id, - ))?; + "Failed parsing abi types for events in contract {} on \ + network {}", + contract.name, network.id, + ))?; let contract = Contract::new( contract.name, @@ -555,9 +561,10 @@ impl SystemConfig { Abi::Evm(evm_abi), ) .context(format!( - "Failed parsing locally defined network contract at network id {}", - network.id - ))?; + "Failed parsing locally defined network contract at network \ + id {}", + network.id + ))?; //Check if contract exists unique_hashmap::try_insert( @@ -566,22 +573,22 @@ impl SystemConfig { contract, ) .context(format!( - "Failed inserting locally defined network contract at network id \ - {}", - network.id, - ))?; + "Failed inserting locally defined network contract at network \ + id {}", + network.id, + ))?; } None => { //Validate that there is a global contract for the given contract if //there is no config if !contracts.get(&contract.name).is_some() { Err(anyhow!( - "Failed to parse contract '{}' for the network '{}'. If you use a \ - global contract definition, please verify that the name \ - reference is correct.", - contract.name, - network.id - ))?; + "Failed to parse contract '{}' for the network '{}'. If \ + you use a global contract definition, please verify that \ + the name reference is correct.", + contract.name, + network.id + ))?; } } } @@ -680,14 +687,15 @@ impl SystemConfig { match contract.config { Some(l_contract) => { let (events, fuel_abi) = Event::from_fuel_events_config( - &l_contract.events, - &l_contract.abi_file_path, - &project_paths, - ) - .context(format!( - "Failed parsing abi types for events in contract {} on network {}", - contract.name, network.id, - ))?; + &l_contract.events, + &l_contract.abi_file_path, + &project_paths, + ) + .context(format!( + "Failed parsing abi types for events in contract {} on \ + network {}", + contract.name, network.id, + ))?; let contract = Contract::new( contract.name.clone(), @@ -697,24 +705,28 @@ impl SystemConfig { )?; //Check if contract exists - unique_hashmap::try_insert(&mut contracts, contract.name.clone(), contract) - .context(format!( - "Failed inserting locally defined network contract at network id \ - {}", - network.id, - ))?; + unique_hashmap::try_insert( + &mut contracts, + contract.name.clone(), + contract, + ) + .context(format!( + "Failed inserting locally defined network contract at network \ + id {}", + network.id, + ))?; } None => { //Validate that there is a global contract for the given contract if //there is no local_contract_config if !contracts.get(&contract.name).is_some() { Err(anyhow!( - "Failed to parse contract '{}' for the network '{}'. If you use a \ - global contract definition, please verify that the name \ - reference is correct.", - contract.name, - network.id - ))?; + "Failed to parse contract '{}' for the network '{}'. If \ + you use a global contract definition, please verify that \ + the name reference is correct.", + contract.name, + network.id + ))?; } } }