From 47e03c66eb260fd7ca37cf9fef16c022f92d8863 Mon Sep 17 00:00:00 2001 From: davidsemakula Date: Thu, 7 Mar 2024 22:29:54 +0300 Subject: [PATCH 1/2] Restrict syntax for setting default ink! e2e test runtime-only emulator --- crates/e2e/macro/src/config.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/e2e/macro/src/config.rs b/crates/e2e/macro/src/config.rs index aaec35b4b4e..b5d561c3480 100644 --- a/crates/e2e/macro/src/config.rs +++ b/crates/e2e/macro/src/config.rs @@ -66,6 +66,7 @@ impl Node { #[derive(Clone, Eq, PartialEq, Debug, darling::FromMeta)] pub enum RuntimeOnly { #[darling(word)] + #[darling(skip)] Default, Runtime(syn::Path), } @@ -134,6 +135,18 @@ mod tests { assert_eq!(config.backend(), Backend::RuntimeOnly(RuntimeOnly::Default)); } + #[test] + #[should_panic(expected = "ErrorUnknownField")] + fn config_works_backend_runtime_only_default_not_allowed() { + let input = quote! { + backend(runtime_only(default)), + }; + let config = + E2EConfig::from_list(&NestedMeta::parse_meta_list(input).unwrap()).unwrap(); + + assert_eq!(config.backend(), Backend::RuntimeOnly(RuntimeOnly::Default)); + } + #[test] fn config_works_runtime_only_with_custom_backend() { let input = quote! { From 8e383880c2894bd9c6297b66b29577912a511cf0 Mon Sep 17 00:00:00 2001 From: davidsemakula Date: Thu, 7 Mar 2024 22:41:13 +0300 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1297a1b950..7380a84942a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Restrict syntax for setting default ink! e2e test runtime-only emulator - [#2143](https://github.com/paritytech/ink/pull/2143) + ## Version 5.0.0-rc.2 ### Added