Skip to content

Commit

Permalink
convert Solidity SC resolution globs to PathBuf
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgar2017 committed Jan 16, 2025
1 parent d7e8a95 commit 513a62d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions compiler_tester/src/vm/eravm/system_contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,12 @@ impl SystemContracts {
"era-contracts/system-contracts/contracts/interfaces/**/*.sol",
"era-contracts/system-contracts/contracts/openzeppelin/**/*.sol",
"tests/solidity/complex/interpreter/*.sol",
] {
for path in glob::glob(pattern)?.filter_map(Result::ok) {
]
.into_iter()
.map(PathBuf::from)
{
for path in glob::glob(pattern.to_str().expect("Always valid"))?.filter_map(Result::ok)
{
let path = path.to_string_lossy().to_string();
if !solidity_file_paths.contains(&path) {
solidity_file_paths.push(path);
Expand Down Expand Up @@ -492,7 +496,10 @@ impl SystemContracts {
)
})?;

if file_path == r"era-contracts\system-contracts\contracts\Constants.sol" {
if file_path
== PathBuf::from("era-contracts/system-contracts/contracts/Constants.sol")
.to_string_lossy()
{
source = source.replace("{{SYSTEM_CONTRACTS_OFFSET}}", "0x8000");
}

Expand Down

0 comments on commit 513a62d

Please sign in to comment.