diff --git a/CHANGELOG.md b/CHANGELOG.md index cfbf85c560..1afe46864b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Use name-only syntax for `anonymous` ink! event item configuration argument - [#2140](https://github.com/paritytech/ink/pull/2140) - Restrict syntax for setting default ink! e2e test runtime-only emulator - [#2143](https://github.com/paritytech/ink/pull/2143) +- Restrict syntax for setting ink! e2e test node to auto - [#2146](https://github.com/paritytech/ink/pull/2146) - Bump Substrate crates - [#2141](https://github.com/paritytech/ink/pull/2141) - Minor fixes - [#2144](https://github.com/paritytech/ink/pull/2144), [#2137](https://github.com/paritytech/ink/pull/2137), [#2132](https://github.com/paritytech/ink/pull/2132) diff --git a/crates/e2e/macro/src/config.rs b/crates/e2e/macro/src/config.rs index b5d561c348..182549edee 100644 --- a/crates/e2e/macro/src/config.rs +++ b/crates/e2e/macro/src/config.rs @@ -40,6 +40,7 @@ impl Default for Backend { pub enum Node { /// A fresh node instance will be spawned for the lifetime of the test. #[darling(word)] + #[darling(skip)] Auto, /// The test will run against an already running node at the supplied URL. Url(String), @@ -137,7 +138,7 @@ mod tests { #[test] #[should_panic(expected = "ErrorUnknownField")] - fn config_works_backend_runtime_only_default_not_allowed() { + fn config_backend_runtime_only_default_not_allowed() { let input = quote! { backend(runtime_only(default)), }; @@ -164,7 +165,7 @@ mod tests { } #[test] - fn config_works_backend_node_default_auto() { + fn config_works_backend_node() { let input = quote! { backend(node), }; @@ -172,15 +173,6 @@ mod tests { E2EConfig::from_list(&NestedMeta::parse_meta_list(input).unwrap()).unwrap(); assert_eq!(config.backend(), Backend::Node(Node::Auto)); - } - - #[test] - fn config_works_backend_node_auto() { - let input = quote! { - backend(node(auto)), - }; - let config = - E2EConfig::from_list(&NestedMeta::parse_meta_list(input).unwrap()).unwrap(); match config.backend() { Backend::Node(node_config) => { @@ -204,6 +196,18 @@ mod tests { } } + #[test] + #[should_panic(expected = "ErrorUnknownField")] + fn config_backend_node_auto_not_allowed() { + let input = quote! { + backend(node(auto)), + }; + let config = + E2EConfig::from_list(&NestedMeta::parse_meta_list(input).unwrap()).unwrap(); + + assert_eq!(config.backend(), Backend::Node(Node::Auto)); + } + #[test] fn config_works_backend_node_url() { let input = quote! {