While building the Substrate Kitties Chain using the tutorial: https://docs.substrate.io/tutorials/v3/kitties/pt1/
I got the error like :
PS C:\Users\msi\kitties-tutorial> cargo build --release
warning: C:\Users\msi\kitties-tutorial\pallets\kitties\Cargo.toml: unused manifest key: dependencies.serde.feature
warning: Git command failed with status: exit code: 128
warning: Could not find
.git/HEAD
searching from C:\Users\msi\kitties-tutorial\node
upwards!
Compiling node-kitties-runtime v4.0.0-dev (C:\Users\msi\kitties-tutorial\runtime)
Compiling pallet-kitties v4.0.0-dev (C:\Users\msi\kitties-tutorial\pallets\kitties)
error[E0433]: failed to resolve: use of undeclared crate or module sp_io
--> pallets\kitties\src\lib.rs:4:5
|
4 | use sp_io::hashing::blake2_128;
| ^^^^^ use of undeclared crate or module sp_io
error[E0425]: cannot find value blake2_128
in this scope
--> pallets\kitties\src\lib.rs:135:26
|
135 | payload.using_encoded(blake2_128)
| ^^^^^^^^^^ help: a unit struct with a similar name exists: Blake2_128
|
::: C:\Users\msi.cargo\git\checkouts\substrate-7e08433d4c370a21\22d40c7\frame\support\src\hash.rs:143:1
|
143 | pub struct Blake2_128;
| ---------------------- similarly named unit struct Blake2_128
defined here
warning: unused import: scale_info::TypeInfo
--> pallets\kitties\src\lib.rs:2:5
|
2 | use scale_info::TypeInfo;
| ^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)]
on by default
I have added sp-io crates in pallets\kitties\cargo.toml in [dev-dependincies] as
sp-io = { default-features = false, version = "5.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.17" }
and in ["std"] as
std = [
"codec/std",
"scale-info/std",
"frame-support/std",
"frame-system/std",
"frame-benchmarking/std",
"sp-io/std",
]