Skip to content

Commit

Permalink
feat(cli): integrate assets parachain template. (#132)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
al3mart authored and peterwht committed May 6, 2024
1 parent 854ad26 commit 03552c5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions crates/pop-parachains/src/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
}
Expand All @@ -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]
Expand Down

0 comments on commit 03552c5

Please sign in to comment.