Skip to content

Commit 154fe44

Browse files
committed
feature fix
1 parent 0af4018 commit 154fe44

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

wasm-deploy/src/commands.rs

+13-14
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ use cosm_utils::{
2020
};
2121
use cosmrs::rpc::client::CompatMode;
2222
use cosmrs::rpc::{HttpClient, HttpClientUrl};
23-
#[cfg(feature = "wasm_opt")]
23+
#[cfg(feature = "wasm-opt")]
2424
use futures::future::join_all;
2525
use inquire::{MultiSelect, Select};
2626
use interactive_parse::InteractiveParseObj;
2727
use log::info;
28-
#[cfg(feature = "wasm_opt")]
28+
#[cfg(feature = "wasm-opt")]
2929
use tokio::task::spawn_blocking;
30-
#[cfg(feature = "wasm_opt")]
30+
#[cfg(feature = "wasm-opt")]
3131
use wasm_opt::integration::run_from_command_args;
3232

3333
use crate::config::WorkspaceSettings;
3434
use crate::cw20::cw20_transfer;
3535
use crate::query::query;
3636
use crate::utils::print_res;
37-
#[cfg(wasm_cli)]
37+
#[cfg(feature = "wasm_cli")]
3838
use crate::wasm_cli::wasm_cli_import_schemas;
3939
use crate::{
4040
cli::{Cli, Commands},
@@ -476,7 +476,7 @@ pub fn schemas(contracts: &[impl Deploy]) -> anyhow::Result<()> {
476476
.wait()?;
477477
}
478478

479-
#[cfg(wasm_cli)]
479+
#[cfg(feature = "wasm_cli")]
480480
// Import schemas
481481
for contract in contracts {
482482
wasm_cli_import_schemas(&contract.name())?;
@@ -496,25 +496,24 @@ pub async fn optimize(
496496
let name = contract.name();
497497
let bin_name = contract.bin_name();
498498
println!("{} {name} contract", " Optimizing".bold().bright_green());
499-
#[cfg(feature = "wasm_opt")]
499+
#[cfg(feature = "wasm-opt")]
500500
{
501501
let mut command = wasm_opt::integration::Command::new("wasm-opt");
502502
command
503503
.arg("-Oz")
504504
.arg("-o")
505505
.arg(settings.artifacts_dir.join(format!("{}.wasm", bin_name)))
506-
.arg(
507-
settings
508-
.target_dir
509-
.join(format!("wasm32-unknown-unknown/release/{bin_name}.wasm")),
510-
);
506+
.arg(settings.target_dir.join(format!(
507+
"wasm32-unknown-unknown/{}/{bin_name}.wasm",
508+
settings.build_profile
509+
)));
511510
handles.push({
512511
spawn_blocking(move || {
513512
run_from_command_args(command).unwrap();
514513
})
515514
})
516515
}
517-
#[cfg(not(feature = "wasm_opt"))]
516+
#[cfg(not(feature = "wasm-opt"))]
518517
{
519518
let mut command = Command::new("wasm-opt");
520519
handles.push(
@@ -535,9 +534,9 @@ pub async fn optimize(
535534
);
536535
}
537536
}
538-
#[cfg(feature = "wasm_opt")]
537+
#[cfg(feature = "wasm-opt")]
539538
join_all(handles).await;
540-
#[cfg(not(feature = "wasm_opt"))]
539+
#[cfg(not(feature = "wasm-opt"))]
541540
handles.iter_mut().for_each(|x| {
542541
x.wait().unwrap();
543542
});

0 commit comments

Comments
 (0)