Skip to content

Commit

Permalink
move file map add up
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjennings-mysten committed Dec 20, 2024
1 parent 75782c9 commit b492ced
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions crates/sui/src/upgrade_compatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,13 @@ fn compare_packages(
.to_string(),
);
let move_toml_hash = FileHash::new(&move_toml_contents);

new_package.package.file_map.add(
FileHash::new(&move_toml_contents),
FileName::from(move_toml_path.to_string_lossy()),
Arc::clone(&move_toml_contents),
);

for (name, err) in errors {
if let UpgradeCompatibilityModeError::ModuleMissing { name, .. } = &err {
diags.extend(missing_module_diag(
Expand All @@ -609,12 +616,6 @@ fn compare_packages(
)?);
}

new_package.package.file_map.add(
FileHash::new(&move_toml_contents),
FileName::from(move_toml_path.to_string_lossy()),
move_toml_contents,
);

// use colors but inline
Err(anyhow!(
"{}\nUpgrade failed, this package requires changes to be compatible with the existing package. \
Expand Down

0 comments on commit b492ced

Please sign in to comment.