From 5d9af67ad98dd9594bfe1ab9ff5833da825503a6 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Tue, 26 Nov 2024 20:18:39 +0200 Subject: [PATCH 1/4] interactor - missing code metadata fix --- framework/scenario/src/scenario/tx_to_step/tx_to_step_deploy.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/scenario/src/scenario/tx_to_step/tx_to_step_deploy.rs b/framework/scenario/src/scenario/tx_to_step/tx_to_step_deploy.rs index 1c7532e27a..75e4555152 100644 --- a/framework/scenario/src/scenario/tx_to_step/tx_to_step_deploy.rs +++ b/framework/scenario/src/scenario/tx_to_step/tx_to_step_deploy.rs @@ -50,6 +50,7 @@ where let mut step = ScDeployStep::new() .from(address_annotated(env, &from)) .code(code_annotated(env, data.code_source)); + step.tx.code_metadata = data.code_metadata; for arg in data.arg_buffer.iter_buffers() { step.tx.arguments.push(arg.to_vec().into()); } From 7008dec060e6959621d59ae4341b54ea18482fca Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Tue, 26 Nov 2024 21:45:49 +0200 Subject: [PATCH 2/4] interactor - deploy default upgradeable --- framework/base/src/types/interaction/tx_data/deploy_call.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/base/src/types/interaction/tx_data/deploy_call.rs b/framework/base/src/types/interaction/tx_data/deploy_call.rs index a742901736..74b40d3828 100644 --- a/framework/base/src/types/interaction/tx_data/deploy_call.rs +++ b/framework/base/src/types/interaction/tx_data/deploy_call.rs @@ -22,7 +22,7 @@ where fn default() -> DeployCall { DeployCall { code_source: (), - code_metadata: CodeMetadata::DEFAULT, + code_metadata: CodeMetadata::UPGRADEABLE, arg_buffer: ManagedArgBuffer::new(), } } From 595b8294c70a1586d1a75e3446c6fd2895d59e52 Mon Sep 17 00:00:00 2001 From: Alin Cruceat Date: Wed, 27 Nov 2024 09:22:36 +0200 Subject: [PATCH 3/4] deprecating sort due to alloc --- .../base/src/types/managed/wrapped/managed_vec.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/framework/base/src/types/managed/wrapped/managed_vec.rs b/framework/base/src/types/managed/wrapped/managed_vec.rs index 3e25360ea4..5cf35be4b6 100644 --- a/framework/base/src/types/managed/wrapped/managed_vec.rs +++ b/framework/base/src/types/managed/wrapped/managed_vec.rs @@ -356,6 +356,8 @@ where M: ManagedTypeApi, T: ManagedVecItem + Ord + Debug, { + #[deprecated(since = "0.54.5", note = "Please use method `sort_unstable` instead.")] + #[cfg(feature = "alloc")] pub fn sort(&mut self) { self.with_self_as_slice_mut(|slice| { slice.sort(); @@ -363,6 +365,11 @@ where }); } + #[deprecated( + since = "0.54.5", + note = "Please use method `sort_unstable_by` instead." + )] + #[cfg(feature = "alloc")] pub fn sort_by(&mut self, mut compare: F) where F: FnMut(&T, &T) -> Ordering, @@ -373,6 +380,11 @@ where }); } + #[deprecated( + since = "0.54.5", + note = "Please use method `sort_unstable_by_key` instead." + )] + #[cfg(feature = "alloc")] pub fn sort_by_key(&mut self, mut f: F) where F: FnMut(&T) -> K, @@ -384,6 +396,8 @@ where }); } + #[deprecated] + #[cfg(feature = "alloc")] pub fn sort_by_cached_key(&mut self, mut f: F) where F: FnMut(&T) -> K, From 54bc4d42c2e12287b0f2f8f7461dc905a04750d4 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Wed, 27 Nov 2024 14:20:21 +0100 Subject: [PATCH 4/4] fix for sc with names containing - --- .../meta-lib/src/contract/generate_snippets/snippet_gen_main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/meta-lib/src/contract/generate_snippets/snippet_gen_main.rs b/framework/meta-lib/src/contract/generate_snippets/snippet_gen_main.rs index 1c77340c64..5642acf6a8 100644 --- a/framework/meta-lib/src/contract/generate_snippets/snippet_gen_main.rs +++ b/framework/meta-lib/src/contract/generate_snippets/snippet_gen_main.rs @@ -25,7 +25,7 @@ use super::{ impl MetaConfig { pub fn generate_rust_snippets(&self, args: &GenerateSnippetsArgs) { let main_contract = self.sc_config.main_contract(); - let crate_name = &main_contract.contract_name; + let crate_name = &main_contract.contract_name.replace("-", "_"); let mut file = create_snippets_crate_and_get_lib_file(&self.snippets_dir, crate_name, args.overwrite); write_snippets_to_file(&mut file, &self.original_contract_abi, crate_name);