Skip to content

Commit

Permalink
refactor: use non-clashing variable name to support global import
Browse files Browse the repository at this point in the history
  • Loading branch information
evilrobot-01 committed Dec 19, 2024
1 parent eabb90a commit cc84982
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions crates/pop-cli/src/commands/up/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use crate::style::{style, Theme};
use clap::Args;
use cliclack::{
clear_screen, confirm, intro, log, multi_progress, outro, outro_cancel, set_theme, ProgressBar,
Theme as _, ThemeState,
clear_screen, confirm, intro, log, multi_progress, outro, outro_cancel, set_theme, spinner,
ProgressBar, Theme as _, ThemeState,
};
use console::{Emoji, Style, Term};
use duct::cmd;
Expand Down Expand Up @@ -91,8 +91,8 @@ impl ZombienetCommand {
}

// Finally spawn network and wait for signal to terminate
let spinner = cliclack::spinner();
spinner.start("🚀 Launching local network...");
let progress = spinner();
progress.start("🚀 Launching local network...");
match zombienet.spawn().await {
Ok(network) => {
let mut result =
Expand Down Expand Up @@ -143,10 +143,10 @@ impl ZombienetCommand {
}

if let Some(command) = &self.command {
run_custom_command(&spinner, command).await?;
run_custom_command(&progress, command).await?;
}

spinner.stop(result);
progress.stop(result);

// Check for any specified channels
if zombienet.hrmp_channels() {
Expand All @@ -156,21 +156,21 @@ impl ZombienetCommand {
log::error(format!("🚫 Using `{relay_chain}` with HRMP channels is currently unsupported. Please use `paseo-local` or `westend-local`."))?;
},
Some(_) => {
let spinner = spinner();
spinner.start("Connecting to relay chain to prepare channels...");
let progress = spinner();
progress.start("Connecting to relay chain to prepare channels...");
// Allow relay node time to start
sleep(Duration::from_secs(10)).await;
spinner.start("Preparing channels...");
progress.set_message("Preparing channels...");
let relay_endpoint = network.relaychain().nodes()[0].client().await?;
let para_ids: Vec<_> =
network.parachains().iter().map(|p| p.para_id()).collect();
tokio::spawn(async move {
if let Err(e) = clear_dmpq(relay_endpoint, &para_ids).await {
spinner.stop("");
progress.stop("");
log::error(format!("🚫 Could not prepare channels: {e}"))?;
return Ok::<(), Error>(());
}
spinner.stop("Channels successfully prepared for initialization.");
progress.stop("Channels successfully prepared for initialization.");
Ok::<(), Error>(())
});
},
Expand Down

0 comments on commit cc84982

Please sign in to comment.