From e54f34596cdc261577615245505ddcd9b45b2a81 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 | 11 +++++++---- 1 file changed, 7 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..2f4d8d0d 100644 --- a/compiler_tester/src/vm/eravm/system_contracts.rs +++ b/compiler_tester/src/vm/eravm/system_contracts.rs @@ -456,7 +456,7 @@ impl SystemContracts { /// fn normalize_path(path: &str, name: Option<&str>) -> String { 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 @@ -482,6 +482,7 @@ impl SystemContracts { } else { path }; + let file_path = Self::normalize_path(file_path.as_str(), None); let mut source = std::fs::read_to_string( PathBuf::from_str(file_path.as_str()) @@ -496,9 +497,11 @@ impl SystemContracts { ) })?; - if PathBuf::from(file_path.as_str()).to_string_lossy() - == PathBuf::from("era-contracts/system-contracts/contracts/Constants.sol") - .to_string_lossy() + if file_path.as_str() + == Self::normalize_path( + "era-contracts/system-contracts/contracts/Constants.sol", + None, + ) { source = source.replace("{{SYSTEM_CONTRACTS_OFFSET}}", "0x8000"); }