From e45047f00bb4b3b9f747da17bb554d3b66ab6bc0 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Wed, 1 May 2024 21:13:52 +0200 Subject: [PATCH 1/8] feat(cli): nfts template --- crates/pop-parachains/src/templates.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/crates/pop-parachains/src/templates.rs b/crates/pop-parachains/src/templates.rs index 5c73486e..35e0a898 100644 --- a/crates/pop-parachains/src/templates.rs +++ b/crates/pop-parachains/src/templates.rs @@ -79,11 +79,21 @@ pub enum Template { props(Provider = "Pop", Repository = "https://github.com/r0gue-io/base-parachain") )] Base, + #[strum( + serialize = "nfts", + message = "Nfts", + detailed_message = "Parachain configured with assets and nfts functionalities.", + props( + Provider = "Pop", + Repository = "https://github.com/r0gue-io/base-parachain/tree/nfts-parachain" + ) + )] + Nfts, // Parity #[strum( serialize = "cpt", message = "Contracts", - detailed_message = "Minimal Substrate node configured for smart contracts via pallet-contracts.", + detailed_message = "Parachain configured with wasm smart contracts (pallet-contracts) support.", props( Provider = "Parity", Repository = "https://github.com/paritytech/substrate-contracts-node" @@ -93,7 +103,7 @@ pub enum Template { #[strum( serialize = "fpt", message = "EVM", - detailed_message = "Template node for a Frontier (EVM) based parachain.", + detailed_message = "Parachain configured with EVM (Frontier) support.", props( Provider = "Parity", Repository = "https://github.com/paritytech/frontier-parachain-template" @@ -143,12 +153,17 @@ mod tests { template = Template::ParityFPT; assert_eq!(template.matches(&Provider::Pop), false); assert_eq!(template.matches(&Provider::Parity), true); + + template = Template::Nfts; + assert_eq!(template.matches(&Provider::Pop), true); + assert_eq!(template.matches(&Provider::Parity), false); } #[test] fn test_convert_string_to_template() { assert_eq!(Template::from_str("base").unwrap(), Template::Base); assert_eq!(Template::from_str("").unwrap_or_default(), Template::Base); + assert_eq!(Template::from_str("nfts").unwrap(), Template::Nfts); assert_eq!(Template::from_str("cpt").unwrap(), Template::ParityContracts); assert_eq!(Template::from_str("fpt").unwrap(), Template::ParityFPT); } @@ -170,6 +185,11 @@ mod tests { template.repository_url().unwrap(), "https://github.com/paritytech/frontier-parachain-template" ); + template = Template::Nfts; + assert_eq!( + template.repository_url().unwrap(), + "https://github.com/r0gue-io/base-parachain/tree/nfts-parachain" + ); } #[test] From 80551f8a216ab1eb1190d17989f38baeb457b935 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Wed, 1 May 2024 23:31:34 +0200 Subject: [PATCH 2/8] style(cli): assets parachain template --- crates/pop-parachains/src/templates.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/pop-parachains/src/templates.rs b/crates/pop-parachains/src/templates.rs index 35e0a898..21d21643 100644 --- a/crates/pop-parachains/src/templates.rs +++ b/crates/pop-parachains/src/templates.rs @@ -80,15 +80,15 @@ pub enum Template { )] Base, #[strum( - serialize = "nfts", - message = "Nfts", - detailed_message = "Parachain configured with assets and nfts functionalities.", + serialize = "assets", + message = "Assets", + detailed_message = "Parachain configured with fungible and non-fungilble asset functionalities.", props( Provider = "Pop", - Repository = "https://github.com/r0gue-io/base-parachain/tree/nfts-parachain" + Repository = "https://github.com/r0gue-io/base-parachain/tree/assets-parachain" ) )] - Nfts, + Assets, // Parity #[strum( serialize = "cpt", @@ -103,7 +103,7 @@ pub enum Template { #[strum( serialize = "fpt", message = "EVM", - detailed_message = "Parachain configured with EVM (Frontier) support.", + detailed_message = "Template node for a Frontier (EVM) based parachain.", props( Provider = "Parity", Repository = "https://github.com/paritytech/frontier-parachain-template" From d0b4f16cfce283c9ec2618b2e60d4cecf9b74ec7 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Wed, 1 May 2024 23:34:55 +0200 Subject: [PATCH 3/8] style(cli): contracts parachain description --- crates/pop-parachains/src/templates.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pop-parachains/src/templates.rs b/crates/pop-parachains/src/templates.rs index 21d21643..2990230e 100644 --- a/crates/pop-parachains/src/templates.rs +++ b/crates/pop-parachains/src/templates.rs @@ -93,7 +93,7 @@ pub enum Template { #[strum( serialize = "cpt", message = "Contracts", - detailed_message = "Parachain configured with wasm smart contracts (pallet-contracts) support.", + detailed_message = "Minimal Substrate node configured for smart contracts via pallet-contracts.", props( Provider = "Parity", Repository = "https://github.com/paritytech/substrate-contracts-node" From b206a720bc3b904a6ef040bb43dcae772171f630 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Thu, 2 May 2024 00:13:09 +0200 Subject: [PATCH 4/8] fix(cli): ammend template tests --- crates/pop-parachains/src/templates.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/pop-parachains/src/templates.rs b/crates/pop-parachains/src/templates.rs index 2990230e..4b2080f7 100644 --- a/crates/pop-parachains/src/templates.rs +++ b/crates/pop-parachains/src/templates.rs @@ -85,7 +85,7 @@ pub enum Template { detailed_message = "Parachain configured with fungible and non-fungilble asset functionalities.", props( Provider = "Pop", - Repository = "https://github.com/r0gue-io/base-parachain/tree/assets-parachain" + Repository = "https://github.com/r0gue-io/base-parachain#assets-parachain" ) )] Assets, @@ -185,10 +185,10 @@ mod tests { template.repository_url().unwrap(), "https://github.com/paritytech/frontier-parachain-template" ); - template = Template::Nfts; + template = Template::Assets; assert_eq!( template.repository_url().unwrap(), - "https://github.com/r0gue-io/base-parachain/tree/nfts-parachain" + "https://github.com/r0gue-io/base-parachain/tree/assets-parachain" ); } From efb19d4ec3ceb109202e3c3fcdeb5b1b2ba907ff Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Thu, 2 May 2024 00:13:44 +0200 Subject: [PATCH 5/8] fix(cli): ammend template tests --- crates/pop-parachains/src/templates.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/pop-parachains/src/templates.rs b/crates/pop-parachains/src/templates.rs index 4b2080f7..d3db4adf 100644 --- a/crates/pop-parachains/src/templates.rs +++ b/crates/pop-parachains/src/templates.rs @@ -154,7 +154,7 @@ mod tests { assert_eq!(template.matches(&Provider::Pop), false); assert_eq!(template.matches(&Provider::Parity), true); - template = Template::Nfts; + template = Template::Assets; assert_eq!(template.matches(&Provider::Pop), true); assert_eq!(template.matches(&Provider::Parity), false); } @@ -163,7 +163,7 @@ mod tests { fn test_convert_string_to_template() { assert_eq!(Template::from_str("base").unwrap(), Template::Base); assert_eq!(Template::from_str("").unwrap_or_default(), Template::Base); - assert_eq!(Template::from_str("nfts").unwrap(), Template::Nfts); + assert_eq!(Template::from_str("assets").unwrap(), Template::Assets); assert_eq!(Template::from_str("cpt").unwrap(), Template::ParityContracts); assert_eq!(Template::from_str("fpt").unwrap(), Template::ParityFPT); } From 8cc9d5560232d66ad1e6e578a9e14ad6d242740c Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Thu, 2 May 2024 00:17:44 +0200 Subject: [PATCH 6/8] fix(cli): ammend template url --- crates/pop-parachains/src/templates.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pop-parachains/src/templates.rs b/crates/pop-parachains/src/templates.rs index d3db4adf..5d0a37b0 100644 --- a/crates/pop-parachains/src/templates.rs +++ b/crates/pop-parachains/src/templates.rs @@ -85,7 +85,7 @@ pub enum Template { detailed_message = "Parachain configured with fungible and non-fungilble asset functionalities.", props( Provider = "Pop", - Repository = "https://github.com/r0gue-io/base-parachain#assets-parachain" + Repository = "https://github.com/r0gue-io/base-parachain/tree/assets-parachain" ) )] Assets, From a239b418a6000f65b25590865bffca1e3b12adaa Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Thu, 2 May 2024 04:39:37 +0200 Subject: [PATCH 7/8] fix(cli): point to new assets template repo --- crates/pop-parachains/src/templates.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/pop-parachains/src/templates.rs b/crates/pop-parachains/src/templates.rs index 5d0a37b0..cb1d6879 100644 --- a/crates/pop-parachains/src/templates.rs +++ b/crates/pop-parachains/src/templates.rs @@ -85,7 +85,7 @@ pub enum Template { detailed_message = "Parachain configured with fungible and non-fungilble asset functionalities.", props( Provider = "Pop", - Repository = "https://github.com/r0gue-io/base-parachain/tree/assets-parachain" + Repository = "https://github.com/r0gue-io/assets-parachain" ) )] Assets, @@ -188,7 +188,7 @@ mod tests { template = Template::Assets; assert_eq!( template.repository_url().unwrap(), - "https://github.com/r0gue-io/base-parachain/tree/assets-parachain" + "https://github.com/r0gue-io/assets-parachain" ); } From 11184696ceb2db453b7ef55d4c0136528d4138c3 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Thu, 2 May 2024 04:42:30 +0200 Subject: [PATCH 8/8] style(cli): fmt --- crates/pop-parachains/src/templates.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/pop-parachains/src/templates.rs b/crates/pop-parachains/src/templates.rs index cb1d6879..27d86dce 100644 --- a/crates/pop-parachains/src/templates.rs +++ b/crates/pop-parachains/src/templates.rs @@ -83,10 +83,7 @@ pub enum Template { serialize = "assets", message = "Assets", detailed_message = "Parachain configured with fungible and non-fungilble asset functionalities.", - props( - Provider = "Pop", - Repository = "https://github.com/r0gue-io/assets-parachain" - ) + props(Provider = "Pop", Repository = "https://github.com/r0gue-io/assets-parachain") )] Assets, // Parity