From 69d94911f54993fc057fc9f736115f925d1265de Mon Sep 17 00:00:00 2001 From: Abhishek Shah Date: Fri, 8 Mar 2024 18:39:40 +0530 Subject: [PATCH] minor adjustments --- src/commands/add/mod.rs | 7 +++---- src/engines/pallet_engine/steps.rs | 7 +------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/commands/add/mod.rs b/src/commands/add/mod.rs index c8de71c5..4c70f8c6 100644 --- a/src/commands/add/mod.rs +++ b/src/commands/add/mod.rs @@ -11,7 +11,7 @@ pub(crate) struct AddArgs { /// Pallet to add to the runtime pub(crate) pallet: AddPallet, #[arg(global = true, short, long)] - /// Runtime path; + /// Runtime path; for example: `sub0/runtime/src/lib.rs` /// Cargo Manifest path will be inferred as `../Cargo.toml` pub(crate) runtime: Option, } @@ -37,9 +37,8 @@ impl AddArgs { let runtime_path = match self.runtime { Some(ref s) => { let path = PathBuf::from(s); - // println!("Using runtime path: {}", &path.display()); if !path.exists() { - anyhow::bail!("Runtime path does not exist: {}", path.display()); + anyhow::bail!("Invalid runtime path: {}", path.display()); } path } @@ -52,7 +51,7 @@ impl AddArgs { } }; let pallet = match self.pallet { - AddPallet::Template => format!("pallet-template"), + AddPallet::Template => format!("pallet-parachain-template"), AddPallet::Frame(FrameArgs { .. }) => { eprintln!("Sorry, frame pallets cannot be added right now"); std::process::exit(1); diff --git a/src/engines/pallet_engine/steps.rs b/src/engines/pallet_engine/steps.rs index 4bf4a2d3..56930f59 100644 --- a/src/engines/pallet_engine/steps.rs +++ b/src/engines/pallet_engine/steps.rs @@ -30,12 +30,6 @@ pub(super) enum Steps { /// PalletEngine State transitions SwitchTo(State), } - -macro_rules! steps { - ($cmd:expr) => { - steps.push($cmd); - }; -} /// Some rules to follow when constructing steps: /// The pallet engine state expects to go as edits would, i.e. top to bottom lexically /// So it makes sense for any given file, to first include an import, then items that refer to it @@ -47,6 +41,7 @@ pub(super) fn step_builder(pallet: AddPallet) -> Result> { AddPallet::Template => { // steps.push(RuntimePalletDependency(Dependency::runtime_template())); steps.push(RuntimePalletImport(quote!( + // Imports by pop-cli pub use pallet_parachain_template; ))); steps.push(SwitchTo(State::Config));