Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,13 @@ pub struct Config {
///
/// This includes what operations can be executed (read, write)
pub fs_permissions: FsPermissions,

/// Temporary config to enable [SpecId::CANCUN]
///
/// <https://github.com/foundry-rs/foundry/issues/5782>
/// Should be removed once EvmVersion Cancun is supported by solc
pub cancun: bool,

/// The root path where the config detection started from, `Config::with_root`
#[doc(hidden)]
// We're skipping serialization here, so it won't be included in the [`Config::to_string()`]
Expand Down Expand Up @@ -689,6 +696,9 @@ impl Config {
/// Returns the [SpecId] derived from the configured [EvmVersion]
#[inline]
pub fn evm_spec_id(&self) -> SpecId {
if self.cancun {
return SpecId::CANCUN
}
evm_spec_id(&self.evm_version)
}

Expand Down Expand Up @@ -1750,6 +1760,7 @@ impl Default for Config {
Self {
profile: Self::DEFAULT_PROFILE,
fs_permissions: FsPermissions::new([PathPermission::read("out")]),
cancun: false,
__root: Default::default(),
src: "src".into(),
test: "test".into(),
Expand Down
1 change: 1 addition & 0 deletions crates/forge/tests/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ forgetest!(can_extract_config_values, |prj: TestProject, mut cmd: TestCommand| {
fmt: Default::default(),
doc: Default::default(),
fs_permissions: Default::default(),
cancun: true,
__non_exhaustive: (),
__warnings: vec![],
};
Expand Down