From 03552c5bb496ec3261b87a95a59f21a834c34675 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Fri, 3 May 2024 09:56:02 +0200 Subject: [PATCH] feat(cli): integrate assets parachain template. (#132) * feat(cli): nfts template * style(cli): assets parachain template * style(cli): contracts parachain description * fix(cli): ammend template tests * fix(cli): ammend template tests * fix(cli): ammend template url * fix(cli): point to new assets template repo * style(cli): fmt --- crates/pop-parachains/src/templates.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/crates/pop-parachains/src/templates.rs b/crates/pop-parachains/src/templates.rs index 6fbe6f6a..3ccf8276 100644 --- a/crates/pop-parachains/src/templates.rs +++ b/crates/pop-parachains/src/templates.rs @@ -84,6 +84,13 @@ pub enum Template { props(Provider = "Pop", Repository = "https://github.com/r0gue-io/base-parachain") )] Base, + #[strum( + 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") + )] + Assets, // Parity #[strum( serialize = "cpt", @@ -155,12 +162,17 @@ mod tests { template = Template::ParityFPT; assert_eq!(template.matches(&Provider::Pop), false); assert_eq!(template.matches(&Provider::Parity), true); + + template = Template::Assets; + 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("assets").unwrap(), Template::Assets); assert_eq!(Template::from_str("cpt").unwrap(), Template::ParityContracts); assert_eq!(Template::from_str("fpt").unwrap(), Template::ParityFPT); } @@ -182,6 +194,11 @@ mod tests { template.repository_url().unwrap(), "https://github.com/paritytech/frontier-parachain-template" ); + template = Template::Assets; + assert_eq!( + template.repository_url().unwrap(), + "https://github.com/r0gue-io/assets-parachain" + ); } #[test]