@@ -102,7 +102,6 @@ pub enum ChainTemplate {
102102 Repository = "https://github.com/r0gue-io/base-parachain" ,
103103 Network = "./network.toml" ,
104104 License = "Unlicense" ,
105- DeploymentName = "POP_STANDARD"
106105 )
107106 ) ]
108107 Standard ,
@@ -117,7 +116,6 @@ pub enum ChainTemplate {
117116 Repository = "https://github.com/r0gue-io/assets-parachain" ,
118117 Network = "./network.toml" ,
119118 License = "Unlicense" ,
120- DeploymentName = "POP_ASSETS"
121119 )
122120 ) ]
123121 Assets ,
@@ -131,7 +129,6 @@ pub enum ChainTemplate {
131129 Repository = "https://github.com/r0gue-io/contracts-parachain" ,
132130 Network = "./network.toml" ,
133131 License = "Unlicense" ,
134- DeploymentName = "POP_CONTRACTS"
135132 )
136133 ) ]
137134 Contracts ,
@@ -147,7 +144,6 @@ pub enum ChainTemplate {
147144 SupportedVersions = "v1.0.0,v2.0.1,v2.0.3,v3.0.0,v4.0.0" ,
148145 IsAudited = "true" ,
149146 License = "GPL-3.0" ,
150- DeploymentName = "OZ_GENERIC"
151147 )
152148 ) ]
153149 OpenZeppelinGeneric ,
@@ -163,7 +159,6 @@ pub enum ChainTemplate {
163159 SupportedVersions = "v2.0.3,v3.0.0,v4.0.0" ,
164160 IsAudited = "true" ,
165161 License = "GPL-3.0" ,
166- DeploymentName = "OZ_EVM"
167162 )
168163 ) ]
169164 OpenZeppelinEVM ,
@@ -177,7 +172,6 @@ pub enum ChainTemplate {
177172 Repository = "https://github.com/paritytech/polkadot-sdk-parachain-template" ,
178173 Network = "./zombienet.toml" ,
179174 License = "Unlicense" ,
180- DeploymentName = "PARITY_GENERIC"
181175 )
182176 ) ]
183177 ParityGeneric ,
@@ -245,28 +239,6 @@ impl ChainTemplate {
245239 self . get_str ( "License" )
246240 }
247241
248- /// Returns the deployment name for the parachain if defined.
249- pub fn deployment_name ( & self ) -> Option < & str > {
250- self . get_str ( "DeploymentName" )
251- }
252-
253- /// Retrieves the deployment name from the `based_on` value.
254- pub fn deployment_name_from_based_on ( based_on : & str ) -> Option < String > {
255- // OpenZeppelin special cases first (https://github.com/OpenZeppelin/polkadot-runtime-templates/pull/406)
256- let mapped_based_on = match based_on {
257- "OpenZeppelin EVM Template" => Some ( ChainTemplate :: OpenZeppelinEVM ) ,
258- "OpenZeppelin Generic Template" => Some ( ChainTemplate :: OpenZeppelinGeneric ) ,
259- _ => None ,
260- } ;
261- if let Some ( variant) = mapped_based_on {
262- return variant. deployment_name ( ) . map ( String :: from) ;
263- }
264- ChainTemplate :: VARIANTS
265- . iter ( )
266- . find ( |variant| variant. as_ref ( ) == based_on)
267- . and_then ( |variant| variant. deployment_name ( ) . map ( String :: from) )
268- }
269-
270242 /// Gets the template name, removing the provider if present.
271243 pub fn template_name_without_provider ( & self ) -> & str {
272244 let name = self . as_ref ( ) ;
@@ -375,20 +347,6 @@ mod tests {
375347 . into ( )
376348 }
377349
378- fn template_deployment_name ( ) -> HashMap < ChainTemplate , Option < & ' static str > > {
379- [
380- ( Standard , Some ( "POP_STANDARD" ) ) ,
381- ( Assets , Some ( "POP_ASSETS" ) ) ,
382- ( Contracts , Some ( "POP_CONTRACTS" ) ) ,
383- ( OpenZeppelinGeneric , Some ( "OZ_GENERIC" ) ) ,
384- ( OpenZeppelinEVM , Some ( "OZ_EVM" ) ) ,
385- ( ParityGeneric , Some ( "PARITY_GENERIC" ) ) ,
386- ( TestTemplate01 , None ) ,
387- ( TestTemplate02 , None ) ,
388- ]
389- . into ( )
390- }
391-
392350 #[ test]
393351 fn test_is_template_correct ( ) {
394352 for template in ChainTemplate :: VARIANTS {
@@ -445,33 +403,6 @@ mod tests {
445403 }
446404 }
447405
448- #[ test]
449- fn deployment_name_works ( ) {
450- let deployment_name = template_deployment_name ( ) ;
451- for template in ChainTemplate :: VARIANTS {
452- assert_eq ! ( template. deployment_name( ) , deployment_name[ template] ) ;
453- }
454- }
455-
456- #[ test]
457- fn deployment_name_from_based_on_works ( ) {
458- for template in ChainTemplate :: VARIANTS {
459- assert_eq ! (
460- ChainTemplate :: deployment_name_from_based_on( template. as_ref( ) ) ,
461- template. deployment_name( ) . map( String :: from) ,
462- ) ;
463- }
464- // test special cases
465- assert_eq ! (
466- ChainTemplate :: deployment_name_from_based_on( "OpenZeppelin EVM Template" ) ,
467- Some ( OpenZeppelinEVM . deployment_name( ) . unwrap( ) . to_string( ) )
468- ) ;
469- assert_eq ! (
470- ChainTemplate :: deployment_name_from_based_on( "OpenZeppelin Generic Template" ) ,
471- Some ( OpenZeppelinGeneric . deployment_name( ) . unwrap( ) . to_string( ) )
472- ) ;
473- }
474-
475406 #[ test]
476407 fn test_default_template_of_provider ( ) {
477408 let mut provider = Provider :: Pop ;
0 commit comments