Skip to content

Commit dbfd8d9

Browse files
authored
feat: add tmp cancun config value (#5790)
1 parent 80c0347 commit dbfd8d9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

crates/config/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,13 @@ pub struct Config {
356356
///
357357
/// This includes what operations can be executed (read, write)
358358
pub fs_permissions: FsPermissions,
359+
360+
/// Temporary config to enable [SpecId::CANCUN]
361+
///
362+
/// <https://github.com/foundry-rs/foundry/issues/5782>
363+
/// Should be removed once EvmVersion Cancun is supported by solc
364+
pub cancun: bool,
365+
359366
/// The root path where the config detection started from, `Config::with_root`
360367
#[doc(hidden)]
361368
// We're skipping serialization here, so it won't be included in the [`Config::to_string()`]
@@ -689,6 +696,9 @@ impl Config {
689696
/// Returns the [SpecId] derived from the configured [EvmVersion]
690697
#[inline]
691698
pub fn evm_spec_id(&self) -> SpecId {
699+
if self.cancun {
700+
return SpecId::CANCUN
701+
}
692702
evm_spec_id(&self.evm_version)
693703
}
694704

@@ -1750,6 +1760,7 @@ impl Default for Config {
17501760
Self {
17511761
profile: Self::DEFAULT_PROFILE,
17521762
fs_permissions: FsPermissions::new([PathPermission::read("out")]),
1763+
cancun: false,
17531764
__root: Default::default(),
17541765
src: "src".into(),
17551766
test: "test".into(),

crates/forge/tests/cli/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ forgetest!(can_extract_config_values, |prj: TestProject, mut cmd: TestCommand| {
114114
fmt: Default::default(),
115115
doc: Default::default(),
116116
fs_permissions: Default::default(),
117+
cancun: true,
117118
__non_exhaustive: (),
118119
__warnings: vec![],
119120
};

0 commit comments

Comments
 (0)