Commit c7411dac authored by Hero Bird's avatar Hero Bird Committed by GitHub

[cli] fix bugs in the template (#224)

parent 098b5a4d
Pipeline #56400 failed with stages
in 25 seconds
...@@ -11,6 +11,6 @@ path = "main.rs" ...@@ -11,6 +11,6 @@ path = "main.rs"
[dependencies] [dependencies]
contract = { path = "../..", package = "{{name}}", default-features = false, features = ["ink-generate-abi"] } contract = { path = "../..", package = "{{name}}", default-features = false, features = ["ink-generate-abi"] }
ink_lang2 = { path = "../../../../../lang2", default-features = false, features = ["ink-generate-abi"] } ink_lang2 = { git = "https://github.com/paritytech/ink", package = "ink_lang2", default-features = false, features = ["ink-generate-abi"] }
serde = "1.0" serde = "1.0"
serde_json = "1.0" serde_json = "1.0"
[package] [package]
name = {{name}} name = "{{name}}"
version = "0.1.0" version = "0.1.0"
authors = ["[your_name] <[your_email]>"] authors = ["[your_name] <[your_email]>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
ink_abi = { path = "../../../abi", default-features = false, features = ["derive"], optional = true } ink_abi = { git = "https://github.com/paritytech/ink", package = "ink_abi", default-features = false, features = ["derive"], optional = true }
ink_core = { path = "../../../core", default-features = false } ink_core = { git = "https://github.com/paritytech/ink", package = "ink_core", default-features = false }
ink_lang2 = { path = "../../../lang2", default-features = false } ink_lang2 = { git = "https://github.com/paritytech/ink", package = "ink_lang2", default-features = false }
scale = { package = "parity-scale-codec", version = "1.0", default-features = false, features = ["derive"] } scale = { package = "parity-scale-codec", version = "1.0", default-features = false, features = ["derive"] }
type-metadata = { git = "https://github.com/type-metadata/type-metadata.git", default-features = false, features = ["derive"], optional = true } type-metadata = { git = "https://github.com/type-metadata/type-metadata.git", default-features = false, features = ["derive"], optional = true }
[lib] [lib]
name = {{name}} name = "{{name}}"
path = "lib.rs"
crate-type = [ crate-type = [
# Used for normal contract Wasm blobs. # Used for normal contract Wasm blobs.
"cdylib", "cdylib",
......
...@@ -56,10 +56,10 @@ mod {{name}} { ...@@ -56,10 +56,10 @@ mod {{name}} {
/// We test if the default constructor does its job. /// We test if the default constructor does its job.
#[test] #[test]
fn default_works() { fn default_works() {
/// Note that even though we defined our `#[ink(constructor)]` // Note that even though we defined our `#[ink(constructor)]`
/// above as `&mut self` functions that return nothing we can call // above as `&mut self` functions that return nothing we can call
/// them in test code as if they were normal Rust constructors // them in test code as if they were normal Rust constructors
/// that take no `self` argument but return `Self`. // that take no `self` argument but return `Self`.
let {{name}} = {{camel_name}}::default(); let {{name}} = {{camel_name}}::default();
assert_eq!({{name}}.get(), false); assert_eq!({{name}}.get(), false);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment