From 8e7b04d8ea0a8dff31139282c8b6436006ffe9a0 Mon Sep 17 00:00:00 2001 From: Enrique Ortiz Date: Wed, 18 Oct 2023 15:05:07 +0900 Subject: [PATCH] fix(features): remove ethers-solc for foundry-compilers --- src/contract.rs | 10 +++++----- src/utils.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 0d8b015..ef894b1 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -85,7 +85,7 @@ impl SourceCodeMetadata { } } - #[cfg(feature = "ethers-solc")] + #[cfg(feature = "foundry-compilers")] pub fn settings(&self) -> Result> { match self { Self::Metadata { settings, .. } => match settings { @@ -103,7 +103,7 @@ impl SourceCodeMetadata { } } - #[cfg(not(feature = "ethers-solc"))] + #[cfg(not(feature = "foundry-compilers"))] pub fn settings(&self) -> Option<&serde_json::Value> { match self { Self::Metadata { settings, .. } => settings.as_ref(), @@ -246,7 +246,7 @@ impl Metadata { } /// Returns the contract's compiler settings. - #[cfg(feature = "ethers-solc")] + #[cfg(feature = "foundry-compilers")] pub fn settings(&self) -> Result { let mut settings = self.source_code.settings()?.unwrap_or_default(); @@ -261,7 +261,7 @@ impl Metadata { } /// Creates a Solc [ProjectBuilder] with this contract's settings. - #[cfg(feature = "ethers-solc")] + #[cfg(feature = "foundry-compilers")] pub fn project_builder(&self) -> Result { let solc_config = SolcConfig::builder().settings(self.settings()?).build(); @@ -269,7 +269,7 @@ impl Metadata { } /// Parses the EVM version. - #[cfg(feature = "ethers-solc")] + #[cfg(feature = "foundry-compilers")] pub fn evm_version(&self) -> Result> { match self.evm_version.as_str() { "" | "Default" => { diff --git a/src/utils.rs b/src/utils.rs index 88b919e..814976d 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -277,7 +277,7 @@ mod tests { de.source_code.sources().get("Contract").unwrap().content, src ); - #[cfg(feature = "ethers-solc")] + #[cfg(feature = "foundry-compilers")] assert!(de.source_code.settings().unwrap().is_none()); // Stringified JSON @@ -294,7 +294,7 @@ mod tests { de.source_code.sources().get("Contract").unwrap().content, src ); - #[cfg(feature = "ethers-solc")] + #[cfg(feature = "foundry-compilers")] assert!(de.source_code.settings().unwrap().is_none()); let json = r#"{"source_code": "source code text"}"#;