Skip to content

Commit

Permalink
fix: EvmVersion from_str (#235)
Browse files Browse the repository at this point in the history
Currently, `EvmVersion` won't get deserialized for `spuriousdragon` and
`tangerinewhistle`.

This can be reproduced using:
```
cast run 0x6b5ca68eb4c4b38690ec12ba9f85409b618759646e50ab53b28f9d67f74978fc --rpc-url=https://rpc.ankr.com/eth --evm-version spuriousDragon
Error: failed to extract foundry config:
foundry config error: Unknown evm version: spuriousdragon for key "default.evm_version" in RunArgs for setting `evm_version`
```

Solution:

Handle camel case and lowercase
  • Loading branch information
yash-atreya authored Dec 20, 2024
1 parent ff2a8d6 commit 4a49c1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/artifacts/solc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,8 @@ impl FromStr for EvmVersion {
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"homestead" => Ok(Self::Homestead),
"tangerineWhistle" => Ok(Self::TangerineWhistle),
"spuriousDragon" => Ok(Self::SpuriousDragon),
"tangerineWhistle" | "tangerinewhistle" => Ok(Self::TangerineWhistle),
"spuriousDragon" | "spuriousdragon" => Ok(Self::SpuriousDragon),
"byzantium" => Ok(Self::Byzantium),
"constantinople" => Ok(Self::Constantinople),
"petersburg" => Ok(Self::Petersburg),
Expand Down

0 comments on commit 4a49c1b

Please sign in to comment.