From c1b029a6b196a1c9e98c04652cd5fe5337ed95b2 Mon Sep 17 00:00:00 2001 From: Trace Andreason Date: Sat, 20 Feb 2021 23:44:57 -0800 Subject: [PATCH 1/3] ink::test attributes in new template --- templates/new/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/new/lib.rs b/templates/new/lib.rs index c81744f8..4cb22b45 100644 --- a/templates/new/lib.rs +++ b/templates/new/lib.rs @@ -53,14 +53,14 @@ mod {{name}} { use super::*; /// We test if the default constructor does its job. - #[test] + #[ink::test] fn default_works() { let {{name}} = {{camel_name}}::default(); assert_eq!({{name}}.get(), false); } /// We test a simple use case of our contract. - #[test] + #[ink::test] fn it_works() { let mut {{name}} = {{camel_name}}::new(false); assert_eq!({{name}}.get(), false); -- GitLab From 5461e780a6909f438d02cb36743402ddb507755f Mon Sep 17 00:00:00 2001 From: Trace Andreason Date: Sun, 21 Feb 2021 20:08:56 -0800 Subject: [PATCH 2/3] add use ink --- templates/new/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/new/lib.rs b/templates/new/lib.rs index 4cb22b45..dd4a0331 100644 --- a/templates/new/lib.rs +++ b/templates/new/lib.rs @@ -52,6 +52,8 @@ mod {{name}} { /// Imports all the definitions from the outer scope so we can use them here. use super::*; + use ink_lang as ink; + /// We test if the default constructor does its job. #[ink::test] fn default_works() { -- GitLab From 18a29822b4adbfc15b313f6f3f62f8a6e6149e70 Mon Sep 17 00:00:00 2001 From: trace-andreason Date: Mon, 29 Mar 2021 08:51:31 -0700 Subject: [PATCH 3/3] Update templates/new/lib.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michael Müller --- templates/new/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/new/lib.rs b/templates/new/lib.rs index dd4a0331..45c4c5ed 100644 --- a/templates/new/lib.rs +++ b/templates/new/lib.rs @@ -52,6 +52,7 @@ mod {{name}} { /// Imports all the definitions from the outer scope so we can use them here. use super::*; + /// Imports `ink_lang` so we can use `#[ink::test]`. use ink_lang as ink; /// We test if the default constructor does its job. -- GitLab