From 783feae1ca62f94df021c318869818c6517e340b Mon Sep 17 00:00:00 2001 From: Jort Date: Thu, 19 Dec 2024 16:08:44 -0800 Subject: [PATCH] move file map add up --- crates/sui/src/upgrade_compatibility.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/sui/src/upgrade_compatibility.rs b/crates/sui/src/upgrade_compatibility.rs index d72ce034681daa..c62350bea56d34 100644 --- a/crates/sui/src/upgrade_compatibility.rs +++ b/crates/sui/src/upgrade_compatibility.rs @@ -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( @@ -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. \