[CODE BUG]: Issues following Kitties tutorial Part 1
See original GitHub issueBug report for compiling, code snippets, templates, etc.
Hi
I was trying several times but only way to go to part 2 just git clone complete solution with all changes done,
Steps to reproduce the problem
In double quotes I show original text from https://docs.substrate.io/tutorials/v3/kitties/pt1/
“Let’s lay out the basic structure of our pallet by outlining the parts inside pallets/mykitties/src/lib.rs.”
There is no mykitties as we enter kitties in kickstarter
“Now try running the following command to build your pallet. We won’t build the entire chain just yet because we haven’t yet implemented the Currency type in our runtime. At least we can check that there are no errors in our pallet so far:”
cargo build -p pallet-kitties
This not gonna compile as
error[E0433]: failed to resolve: use of undeclared crate or module sp_io
–> pallets/kitties/src/lib.rs:12:9
|
12 | use sp_io::hashing::blake2_128;
| ^^^^^ use of undeclared crate or module sp_io
And reason is that kickstarted generated Cargo.toml mention sp-io only for devdependencies
[dev-dependencies.sp-io] default-features = false git = ‘https://github.com/paritytech/substrate.git’ tag = ‘monthly-2021-10’ version = ‘4.0.0-dev’
So through article there situation where cargo.toml involved. Maybe make sense to show this changes in same manner like changes in .rs files.
“Now build your node and make sure you don’t have any errors. This will take a little while at first.”
cargo build --release
It worth mention that we go to root folder of project to build root node. As previous commands run from pallets/kitties subfolder.
Anyhow this build failed:
error: SubstrateKitties
does not have #[pallet::genesis_config] defined, perhaps you should remove Config
from construct_runtime?
–> /home/user/study/substrate/my5/kitties/runtime/src/lib.rs:281:1
|
281 | / construct_runtime!(
282 | | pub enum Runtime where
283 | | Block = Block,
284 | | NodeBlock = opaque::Block,
… |
298 | | }
299 | | );
| |_^
|
= note: this error originates in the macro pallet_kitties::__substrate_genesis_config_check::is_genesis_config_defined
(in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait core::convert::From<pallet_kitties::Event<Runtime>>
for type Event
–> /home/user/study/substrate/my5/kitties/runtime/src/lib.rs:281:1
|
281 | / construct_runtime!(
282 | | pub enum Runtime where
283 | | Block = Block,
284 | | NodeBlock = opaque::Block,
… |
298 | | }
299 | | );
| | ^
| | |
| |_first implementation here
| conflicting implementation for Event
|
= note: this error originates in the macro construct_runtime
(in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait core::convert::From<pallet_kitties::Call<Runtime>>
for type Call
–> /home/user/study/substrate/my5/kitties/runtime/src/lib.rs:281:1
|
281 | / construct_runtime!(
282 | | pub enum Runtime where
283 | | Block = Block,
284 | | NodeBlock = opaque::Block,
… |
298 | | }
299 | | );
| | ^
| | |
| |_first implementation here
| conflicting implementation for Call
|
= note: this error originates in the macro construct_runtime
(in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait core::convert::TryInto<pallet_kitties::Event<Runtime>>
for type Event
–> /home/user/study/substrate/my5/kitties/runtime/src/lib.rs:281:1
|
281 | / construct_runtime!(
282 | | pub enum Runtime where
283 | | Block = Block,
284 | | NodeBlock = opaque::Block,
… |
298 | | }
299 | | );
| | ^
| | |
| |_first implementation here
| conflicting implementation for Event
|
= note: this error originates in the macro construct_runtime
(in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait sp_api_hidden_includes_construct_runtime::hidden_include::traits::IsSubType<pallet_kitties::Call<Runtime>>
for type Call
–> /home/user/study/substrate/my5/kitties/runtime/src/lib.rs:281:1
|
281 | / construct_runtime!(
282 | | pub enum Runtime where
283 | | Block = Block,
284 | | NodeBlock = opaque::Block,
… |
298 | | }
299 | | );
| | ^
| | |
| |_first implementation here
| conflicting implementation for Call
|
= note: this error originates in the macro construct_runtime
(in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try rustc --explain E0119
.
error: could not compile node-kitties-runtime
due to 5 previous errors
warning: build failed, waiting for other jobs to finish…
error: build failed
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top GitHub Comments
Hi @manylov - the clause I added:
…means that you need to remove the
dev-
so that its included as a dependancy not as adev-dependency
.The other clause:
… is just a note for when we may already have the last
monthly
tag of the template but it’s not updated in the tutorial. Its more of a precautionary note. In your case it should work fine.Let me know if this works!
Thanks for flagging these issues @cryply 🙏🏻. I’ve made a PR to address them 😁