From 513a62dfaf664caa3b1f675b75c2235c90545d4d Mon Sep 17 00:00:00 2001 From: Oleksandr Zarudnyi Date: Thu, 16 Jan 2025 17:13:55 +0800 Subject: [PATCH] convert Solidity SC resolution globs to PathBuf --- compiler_tester/src/vm/eravm/system_contracts.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/compiler_tester/src/vm/eravm/system_contracts.rs b/compiler_tester/src/vm/eravm/system_contracts.rs index 3bbc1672..e85c2478 100644 --- a/compiler_tester/src/vm/eravm/system_contracts.rs +++ b/compiler_tester/src/vm/eravm/system_contracts.rs @@ -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); @@ -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"); }