From 8bf0561399e9f6d9c62b487225e68ea816bec258 Mon Sep 17 00:00:00 2001 From: Oleksandr Zarudnyi Date: Fri, 17 Jan 2025 21:43:56 +0800 Subject: [PATCH] add debug --- compiler_tester/src/vm/eravm/system_contracts.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/compiler_tester/src/vm/eravm/system_contracts.rs b/compiler_tester/src/vm/eravm/system_contracts.rs index af77cc00..7ec79924 100644 --- a/compiler_tester/src/vm/eravm/system_contracts.rs +++ b/compiler_tester/src/vm/eravm/system_contracts.rs @@ -455,8 +455,9 @@ impl SystemContracts { /// Returns a unified path for a system contract. /// fn normalize_path(path: &str, name: Option<&str>) -> String { + dbg!(std::path::MAIN_SEPARATOR_STR); let contract_name = era_compiler_common::ContractName::new( - path.to_string(), + path.replace("/", std::path::MAIN_SEPARATOR_STR), name.map(|name| name.to_string()), ); contract_name.full_path @@ -496,9 +497,16 @@ impl SystemContracts { ) })?; - if PathBuf::from(file_path.as_str()).to_string_lossy() - == PathBuf::from("era-contracts/system-contracts/contracts/Constants.sol") - .to_string_lossy() + dbg!(Self::normalize_path(file_path.as_str(), None)); + dbg!(Self::normalize_path( + "era-contracts/system-contracts/contracts/Constants.sol", + None + )); + if Self::normalize_path(file_path.as_str(), None) + == Self::normalize_path( + "era-contracts/system-contracts/contracts/Constants.sol", + None, + ) { source = source.replace("{{SYSTEM_CONTRACTS_OFFSET}}", "0x8000"); }