From 6f8ef5ab5b844f6a370b348c0bf7c40574346639 Mon Sep 17 00:00:00 2001 From: Abhishek Shah Date: Wed, 1 May 2024 12:36:15 +0530 Subject: [PATCH] scaffold pop install --- Cargo.lock | 1 + crates/pop-cli/Cargo.toml | 1 + crates/pop-cli/src/commands/mod.rs | 1 + crates/pop-cli/src/main.rs | 28 ++++++++++++++++------------ crates/pop-parachains/src/up.rs | 2 +- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b61ae280..4b5ba4ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5476,6 +5476,7 @@ dependencies = [ "pop-contracts", "pop-parachains", "predicates", + "reqwest", "sp-core 30.0.0", "sp-weights", "strum 0.26.2", diff --git a/crates/pop-cli/Cargo.toml b/crates/pop-cli/Cargo.toml index 1d027f9e..c6c59c55 100644 --- a/crates/pop-cli/Cargo.toml +++ b/crates/pop-cli/Cargo.toml @@ -14,6 +14,7 @@ duct.workspace = true tempfile.workspace = true url.workspace = true tokio.workspace = true +reqwest.workspace = true # pop-cli clap.workspace = true diff --git a/crates/pop-cli/src/commands/mod.rs b/crates/pop-cli/src/commands/mod.rs index 9dde6917..e2407e1c 100644 --- a/crates/pop-cli/src/commands/mod.rs +++ b/crates/pop-cli/src/commands/mod.rs @@ -5,3 +5,4 @@ pub(crate) mod call; pub(crate) mod new; pub(crate) mod test; pub(crate) mod up; +pub(crate) mod install; diff --git a/crates/pop-cli/src/main.rs b/crates/pop-cli/src/main.rs index af707305..cf750226 100644 --- a/crates/pop-cli/src/main.rs +++ b/crates/pop-cli/src/main.rs @@ -36,20 +36,23 @@ enum Commands { #[clap(alias = "t")] #[cfg(feature = "contract")] Test(commands::test::TestArgs), + /// Install tools for Substrate development + #[clap(alias = "i")] + Install(commands::install::InstallArgs) } #[tokio::main] async fn main() -> Result<()> { let cli = Cli::parse(); match cli.command { - Commands::New(args) => Ok(match &args.command { + Commands::New(args) => match &args.command { #[cfg(feature = "parachain")] - commands::new::NewCommands::Parachain(cmd) => cmd.execute().await?, + commands::new::NewCommands::Parachain(cmd) => cmd.execute().await, #[cfg(feature = "parachain")] - commands::new::NewCommands::Pallet(cmd) => cmd.execute().await?, + commands::new::NewCommands::Pallet(cmd) => cmd.execute().await, #[cfg(feature = "contract")] - commands::new::NewCommands::Contract(cmd) => cmd.execute().await?, - }), + commands::new::NewCommands::Contract(cmd) => cmd.execute().await, + }, Commands::Build(args) => match &args.command { #[cfg(feature = "parachain")] commands::build::BuildCommands::Parachain(cmd) => cmd.execute(), @@ -57,19 +60,20 @@ async fn main() -> Result<()> { commands::build::BuildCommands::Contract(cmd) => cmd.execute(), }, #[cfg(feature = "contract")] - Commands::Call(args) => Ok(match &args.command { - commands::call::CallCommands::Contract(cmd) => cmd.execute().await?, - }), - Commands::Up(args) => Ok(match &args.command { + Commands::Call(args) => match &args.command { + commands::call::CallCommands::Contract(cmd) => cmd.execute().await, + }, + Commands::Up(args) => match &args.command { #[cfg(feature = "parachain")] - commands::up::UpCommands::Parachain(cmd) => cmd.execute().await?, + commands::up::UpCommands::Parachain(cmd) => cmd.execute().await, #[cfg(feature = "contract")] - commands::up::UpCommands::Contract(cmd) => cmd.execute().await?, - }), + commands::up::UpCommands::Contract(cmd) => cmd.execute().await, + }, #[cfg(feature = "contract")] Commands::Test(args) => match &args.command { commands::test::TestCommands::Contract(cmd) => cmd.execute(), }, + Commands::Install(args) => args.execute().await, } } diff --git a/crates/pop-parachains/src/up.rs b/crates/pop-parachains/src/up.rs index 612e11b5..79fb446b 100644 --- a/crates/pop-parachains/src/up.rs +++ b/crates/pop-parachains/src/up.rs @@ -18,7 +18,7 @@ use zombienet_sdk::{Network, NetworkConfig, NetworkConfigExt}; use zombienet_support::fs::local::LocalFileSystem; const POLKADOT_SDK: &str = "https://github.com/paritytech/polkadot-sdk"; -const POLKADOT_DEFAULT_VERSION: &str = "v1.10.0"; +const POLKADOT_DEFAULT_VERSION: &str = "v1.11.0"; pub struct Zombienet { /// The cache location, used for caching binaries.