question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CODE BUG]: Issues following Kitties tutorial Part 1

See original GitHub issue

Bug 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:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
sacha-lcommented, Oct 29, 2021

Hi @manylov - the clause I added:

Notice that we’re using sp_io in our pallet. Ensure that this is declared as a dependency in your pallet’s Cargo.toml file:

…means that you need to remove the dev- so that its included as a dependancy not as a dev-dependency.

The other clause:

Check that you’re using the correct monthly- tag and version otherwise you will get a dependency error. Here, we’re using the monthly-2021-10 tag of Substrate.*

… 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!

1reaction
sacha-lcommented, Oct 27, 2021

Thanks for flagging these issues @cryply 🙏🏻. I’ve made a PR to address them 😁

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial · Cats Effect - Typelevel
This tutorial tries to help newcomers to cats-effect to get familiar with its main concepts by means of code examples, in a learn-by-doing...
Read more >
JavaScript for Cats
JavaScript For Cats. An introduction for new programmers cat. So easy your human companion could do it too! JavaScript is a programming language...
Read more >
Module parse failed: Unexpected token. You may ... - GitHub
This is a library build issue. We moved to ts3.8 without thinking about optional chaining transpiling. Here seems like a correct way to...
Read more >
How to Classify Photos of Dogs and Cats (with 97% accuracy)
After completing this tutorial, you will know: ... Updated Dec/2021: Fix typo in code of section “Pre-Process Photo Sizes (Optional)”.
Read more >
Gradient Workflows Tutorial - Paperspace Docs
The reason for this is that Gradient Workflows is designed to keep our code version-controlled during the application development process and during Part...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found