Skip to content

Commit

Permalink
add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgar2017 committed Jan 18, 2025
1 parent 22413c8 commit 8bf0561
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions compiler_tester/src/vm/eravm/system_contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit 8bf0561

Please sign in to comment.