From 1052c5327960ec89f714dfebff74efd455c66e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20P=C5=82askonka?= Date: Fri, 24 May 2024 13:50:14 +0200 Subject: [PATCH] Attemt #2 --- src/actions/build.rs | 2 ++ src/command.rs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/actions/build.rs b/src/actions/build.rs index df7fb99..cc0f4db 100644 --- a/src/actions/build.rs +++ b/src/actions/build.rs @@ -49,7 +49,9 @@ impl BuildAction<'_> { &contract.struct_name(), &module_name, self.project.is_workspace(), + contract.module_crate_name(self.project), ); + let source = paths::wasm_path_in_target(&build_contract, self.project.project_root()); let target = paths::wasm_path_in_wasm_dir(&contract.struct_name(), &self.project.project_root()); diff --git a/src/command.rs b/src/command.rs index 9b77299..0e58e01 100644 --- a/src/command.rs +++ b/src/command.rs @@ -124,6 +124,7 @@ pub fn cargo_build_wasm_files( contract_name: &str, module_name: &str, is_workspace: bool, + crate_name: String, ) { env::set_var(ODRA_MODULE_ENV_KEY, contract_name); let build_contract = format!("{}_build_contract", module_name); @@ -136,7 +137,7 @@ pub fn cargo_build_wasm_files( ]; if is_workspace { params.push("--package"); - params.push(module_name); + params.push(crate_name.as_str()); } cargo(current_dir, "build", params); }