0

I am following following tutorial to write collectibles pallet: https://docs.substrate.io/tutorials/collectibles-workshop/.

My source code is available here: https://github.com/sayyedkamran/substrate-node-template

The collectible pallet compiled successfully. When I try to add it to the runtime it is giving some very strange errors:

syedkamran@192 substrate-node-template % cargo build --release
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
    Blocking waiting for file lock on package cache
   Compiling node-template-runtime v4.0.0-dev (/Users/syedkamran/polkadot/kamran/substrate-node-template/runtime)
error: failed to run custom build command for `node-template-runtime v4.0.0-dev (/Users/syedkamran/polkadot/kamran/substrate-node-template/runtime)`

Caused by:
  process didn't exit successfully: `/Users/syedkamran/polkadot/kamran/substrate-node-template/target/release/build/node-template-runtime-dbf9bf989bdc97d4/build-script-build` (exit status: 1)
  --- stdout
  Information that should be included in a bug report.
  Executing build command: RUSTFLAGS="-C target-cpu=mvp -C target-feature=-sign-ext -C link-arg=--export-table -Clink-arg=--export=__heap_base -C link-arg=--import-memory  " SKIP_WASM_BUILD="" "/Users/syedkamran/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/Users/syedkamran/polkadot/kamran/substrate-node-template/target/release/wbuild/node-template-runtime/Cargo.toml" "--color=always" "--profile" "release"
  Using rustc version: rustc 1.74.0-nightly (8550f15e1 2023-08-27)

  --- stderr
     Compiling node-template-runtime v4.0.0-dev (/Users/syedkamran/polkadot/kamran/substrate-node-template/runtime)
  error[E0433]: failed to resolve: could not find `__private` in `frame_support`
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:289:1
      |
  289 | / construct_runtime!(
  290 | |     pub struct Runtime {
  291 | |         System: frame_system,
  292 | |         Timestamp: pallet_timestamp,
  ...   |
  301 | |     }
  302 | | );
      | |_^ could not find `__private` in `frame_support`
      |
      = note: this error originates in the macro `collectibles::tt_default_parts` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)

  error[E0412]: cannot find type `Aura` in this scope
    --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:92:14
     |
  92 |             pub aura: Aura,
     |                       ^^^^ not found in this scope

  error[E0412]: cannot find type `Grandpa` in this scope
    --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:93:17
     |
  93 |             pub grandpa: Grandpa,
     |                          ^^^^^^^ help: a type alias with a similar name exists: `GrandpaId`
     |
    ::: /Users/syedkamran/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/primitives/consensus/grandpa/src/lib.rs:57:1
     |
  57 | pub type AuthorityId = app::Public;
     | -------------------- similarly named type alias `GrandpaId` defined here

  error[E0412]: cannot find type `Aura` in this scope
    --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:92:14
     |
  92 |             pub aura: Aura,
     |                       ^^^^ not found in this scope
     |
  help: you might be missing a type parameter
    --> /Users/syedkamran/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/primitives/runtime/src/traits.rs:1997:19
     |
  199|         pub struct $name<Aura> {
     |                         ++++++

  error[E0412]: cannot find type `Grandpa` in this scope
    --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:93:17
     |
  93 |             pub grandpa: Grandpa,
     |                          ^^^^^^^
     |
    ::: /Users/syedkamran/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/primitives/consensus/grandpa/src/lib.rs:57:1
     |
  57 | pub type AuthorityId = app::Public;
     | -------------------- similarly named type alias `GrandpaId` defined here
     |
  help: a type alias with a similar name exists
     |
  93 |             pub grandpa: GrandpaId,
     |                          ~~~~~~~~~
  help: you might be missing a type parameter
    --> /Users/syedkamran/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/primitives/runtime/src/traits.rs:1997:19
     |
  199|         pub struct $name<Grandpa> {
     |                         +++++++++

  error[E0412]: cannot find type `Aura` in this scope
    --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:92:14
     |
  92 |             pub aura: Aura,
     |                       ^^^^ not found in this scope
     |
  help: you might be missing a type parameter
    --> /Users/syedkamran/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/primitives/runtime/src/traits.rs:1994:32
     |
  199|             $crate::scale_info::TypeInfo<Aura>,
     |                                         ++++++

  error[E0412]: cannot find type `Grandpa` in this scope
    --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:93:17
     |
  93 |             pub grandpa: Grandpa,
     |                          ^^^^^^^
     |
    ::: /Users/syedkamran/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/primitives/consensus/grandpa/src/lib.rs:57:1
     |
  57 | pub type AuthorityId = app::Public;
     | -------------------- similarly named type alias `GrandpaId` defined here
     |
  help: a type alias with a similar name exists
     |
  93 |             pub grandpa: GrandpaId,
     |                          ~~~~~~~~~
  help: you might be missing a type parameter
    --> /Users/syedkamran/.cargo/git/checkouts/substrate-7e08433d4c370a21/948fbd2/primitives/runtime/src/traits.rs:1994:32
     |
  199|             $crate::scale_info::TypeInfo<Grandpa>,
     |                                         +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:158:31
      |
  158 | impl frame_system::Config for Runtime {
      |                               ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeCall` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:170:21
      |
  170 |     type RuntimeCall = RuntimeCall;
      |                        ^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeCall`

  error[E0412]: cannot find type `RuntimeEvent` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:180:22
      |
  180 |     type RuntimeEvent = RuntimeEvent;
      |                         ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent`

  error[E0412]: cannot find type `RuntimeOrigin` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:182:23
      |
  182 |     type RuntimeOrigin = RuntimeOrigin;
      |                          ^^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeOrigin`

  error[E0412]: cannot find type `PalletInfo` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:192:20
      |
  192 |     type PalletInfo = PalletInfo;
      |                       ^^^^^^^^^^
      |
  help: you might have meant to use the associated type
      |
  192 |     type PalletInfo = Self::PalletInfo;
      |                       ~~~~~~~~~~~~~~~~
  help: consider importing this trait
      |
  9   + use frame_support::traits::PalletInfo;
      |

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:208:30
      |
  208 | impl pallet_aura::Config for Runtime {
      |                              ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:215:33
      |
  215 | impl pallet_grandpa::Config for Runtime {
      |                                 ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeEvent` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:216:22
      |
  216 |     type RuntimeEvent = RuntimeEvent;
      |                         ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent`

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:226:35
      |
  226 | impl pallet_timestamp::Config for Runtime {
      |                                   ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Aura` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:229:24
      |
  229 |     type OnTimestampSet = Aura;
      |                           ^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:237:34
      |
  237 | impl pallet_balances::Config for Runtime {
      |                                  ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeEvent` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:244:22
      |
  244 |     type RuntimeEvent = RuntimeEvent;
      |                         ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent`

  error[E0412]: cannot find type `System` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:247:22
      |
  247 |     type AccountStore = System;
      |                         ^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:248:62
      |
  248 |     type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
      |                                                                 ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  237 | impl<Runtime> pallet_balances::Config for Runtime {
      |     +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:259:45
      |
  259 | impl pallet_transaction_payment::Config for Runtime {
      |                                             ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeEvent` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:260:22
      |
  260 |     type RuntimeEvent = RuntimeEvent;
      |                         ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent`

  error[E0412]: cannot find type `Balances` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:261:45
      |
  66  | pub type Balance = u128;
      | ------------------------ similarly named type alias `Balance` defined here
  ...
  261 |     type OnChargeTransaction = CurrencyAdapter<Balances, ()>;
      |                                                ^^^^^^^^
      |
  help: a type alias with a similar name exists
      |
  261 |     type OnChargeTransaction = CurrencyAdapter<Balance, ()>;
      |                                                ~~~~~~~
  help: you might be missing a type parameter
      |
  259 | impl<Balances> pallet_transaction_payment::Config for Runtime {
      |     ++++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:268:30
      |
  268 | impl pallet_sudo::Config for Runtime {
      |                              ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeEvent` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:269:22
      |
  269 |     type RuntimeEvent = RuntimeEvent;
      |                         ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent`

  error[E0412]: cannot find type `RuntimeCall` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:270:21
      |
  270 |     type RuntimeCall = RuntimeCall;
      |                        ^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeCall`

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:271:58
      |
  271 |     type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>;
      |                                                             ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  268 | impl<Runtime> pallet_sudo::Config for Runtime {
      |     +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:275:34
      |
  275 | impl pallet_template::Config for Runtime {
      |                                  ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeEvent` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:276:22
      |
  276 |     type RuntimeEvent = RuntimeEvent;
      |                         ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent`

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:277:62
      |
  277 |     type WeightInfo = pallet_template::weights::SubstrateWeight<Runtime>;
      |                                                                 ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  275 | impl<Runtime> pallet_template::Config for Runtime {
      |     +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:281:31
      |
  281 | impl collectibles::Config for Runtime {
      |                               ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeEvent` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:282:25
      |
  282 |     type RuntimeEvent = RuntimeEvent;
      |                         ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent`

  error[E0412]: cannot find type `Balances` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:283:21
      |
  66  | pub type Balance = u128;
      | ------------------------ similarly named type alias `Balance` defined here
  ...
  283 |     type Currency = Balances;
      |                     ^^^^^^^^ help: a type alias with a similar name exists: `Balance`

  error[E0412]: cannot find type `RandomnessCollectiveFlip` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:284:33
      |
  284 |     type CollectionRandomness = RandomnessCollectiveFlip;
      |                                 ^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:312:35
      |
  312 |     frame_system::CheckNonZeroSender<Runtime>,
      |                                      ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  311 | pub type SignedExtra<Runtime> = (
      |                     +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:313:33
      |
  313 |     frame_system::CheckSpecVersion<Runtime>,
      |                                    ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  311 | pub type SignedExtra<Runtime> = (
      |                     +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:314:31
      |
  314 |     frame_system::CheckTxVersion<Runtime>,
      |                                  ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  311 | pub type SignedExtra<Runtime> = (
      |                     +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:315:29
      |
  315 |     frame_system::CheckGenesis<Runtime>,
      |                                ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  311 | pub type SignedExtra<Runtime> = (
      |                     +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:316:25
      |
  316 |     frame_system::CheckEra<Runtime>,
      |                            ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  311 | pub type SignedExtra<Runtime> = (
      |                     +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:317:27
      |
  317 |     frame_system::CheckNonce<Runtime>,
      |                              ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  311 | pub type SignedExtra<Runtime> = (
      |                     +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:318:28
      |
  318 |     frame_system::CheckWeight<Runtime>,
      |                               ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  311 | pub type SignedExtra<Runtime> = (
      |                     +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:319:55
      |
  319 |     pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
      |                                                          ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  311 | pub type SignedExtra<Runtime> = (
      |                     +++++++++

  error[E0412]: cannot find type `RuntimeCall` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:324:39
      |
  324 |     generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
      |                                          ^^^^^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  323 | pub type UncheckedExtrinsic<RuntimeCall> =
      |                            +++++++++++++

  error[E0412]: cannot find type `RuntimeCall` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:326:49
      |
  326 | pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
      |                                                 ^^^^^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  326 | pub type SignedPayload<RuntimeCall> = generic::SignedPayload<RuntimeCall, SignedExtra>;
      |                       +++++++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:329:2
      |
  329 |     Runtime,
      |     ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  328 | pub type Executive<Runtime> = frame_executive::Executive<
      |                   +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:331:29
      |
  331 |     frame_system::ChainContext<Runtime>,
      |                                ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  328 | pub type Executive<Runtime> = frame_executive::Executive<
      |                   +++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:332:2
      |
  332 |     Runtime,
      |     ^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  328 | pub type Executive<Runtime> = frame_executive::Executive<
      |                   +++++++++

  error[E0412]: cannot find type `AllPalletsWithSystem` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:333:2
      |
  333 |     AllPalletsWithSystem,
      |     ^^^^^^^^^^^^^^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  328 | pub type Executive<AllPalletsWithSystem> = frame_executive::Executive<
      |                   ++++++++++++++++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:353:31
      |
  353 |     impl sp_api::Core<Block> for Runtime {
      |                                  ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:367:35
      |
  367 |     impl sp_api::Metadata<Block> for Runtime {
      |                                      ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:381:49
      |
  381 |     impl sp_block_builder::BlockBuilder<Block> for Runtime {
      |                                                    ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:402:75
      |
  402 |     impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
      |                                                                              ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:412:49
      |
  412 |     impl sp_offchain::OffchainWorkerApi<Block> for Runtime {
      |                                                    ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:418:53
      |
  418 |     impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
      |                                                        ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:428:42
      |
  428 |     impl sp_session::SessionKeys<Block> for Runtime {
      |                                             ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:440:51
      |
  440 |     impl sp_consensus_grandpa::GrandpaApi<Block> for Runtime {
      |                                                      ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:470:82
      |
  470 |     impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
      |                                                                                     ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:476:93
      |
  476 |     impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {
      |                                                                                                ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeCall` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:497:93
      |
  497 |     impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
      |                                                                                                ^^^^^^^^^^^ not found in this scope
      |
  help: you might be missing a type parameter
      |
  497 |     impl<RuntimeCall> pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
      |         +++++++++++++

  error[E0412]: cannot find type `Runtime` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:498:7
      |
  498 |         for Runtime
      |             ^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeCall` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:501:10
      |
  501 |             call: RuntimeCall,
      |                   ^^^^^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeCall` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:507:10
      |
  507 |             call: RuntimeCall,
      |                   ^^^^^^^^^^^ not found in this scope

  error[E0412]: cannot find type `RuntimeCall` in this scope
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:497:93
      |
  497 |     impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
      |                                                                                                ^^^^^^^^^^^ not found in this scope

  error[E0152]: duplicate lang item in crate `sp_io` (which `frame_support` depends on): `panic_impl`.
    |
    = note: the lang item is first defined in crate `sp_io` (which `sp_application_crypto` depends on)
    = note: first definition in `sp_io` loaded from /Users/syedkamran/polkadot/kamran/substrate-node-template/target/release/wbuild/node-template-runtime/target/wasm32-unknown-unknown/release/deps/libsp_io-3d99c77e35d60298.rmeta
    = note: second definition in `sp_io` loaded from /Users/syedkamran/polkadot/kamran/substrate-node-template/target/release/wbuild/node-template-runtime/target/wasm32-unknown-unknown/release/deps/libsp_io-2276528edc6133c9.rmeta

  error[E0433]: failed to resolve: use of undeclared type `Runtime`
     --> /Users/syedkamran/polkadot/kamran/substrate-node-template/runtime/src/lib.rs:369:24
      |
  369 |             OpaqueMetadata::new(Runtime::metadata().into())
      |                                 ^^^^^^^ use of undeclared type `Runtime`

  error[E0433]: failed to resolve: use of undeclared type `Runtime`
     --> /Users/syedkamran/polkadot/kamran/substrate-node-
1
  • __private module doesn't export any items. Commented Sep 20, 2023 at 7:01

1 Answer 1

0

I don't think this is the main error. The macro is unable to generate code correctly, resulting in multiple errors.

Based on my observation:

error[E0152]: duplicate lang item in crate `sp_io` (which `frame_support` depends on): `panic_impl`.
    |
    = note: the lang item is first defined in crate `sp_io` (which `sp_application_crypto` depends on)
    = note: first definition in `sp_io` loaded from /Users/syedkamran/polkadot/kamran/substrate-node-template/target/release/wbuild/node-template-runtime/target/wasm32-unknown-unknown/release/deps/libsp_io-3d99c77e35d60298.rmeta
    = note: second definition in `sp_io` loaded from /Users/syedkamran/polkadot/kamran/substrate-node-template/target/release/wbuild/node-template-runtime/target/wasm32-unknown-unknown/release/deps/libsp_io-2276528edc6133c9.rmeta

I believe you may have missed some "xxx/std" entries in your Cargo.toml, or you are using different versions of dependencies. Please check your Cargo.lock; generally, there should only be one Substrate version.

1
  • You seems to be right. The issue is, everything gets compiled correctly, as soon as I add collectibles pallet to the runtime, these strange errors pops in. I observer following strange thing in the cargo.lock file [[package]] name = "frame-system" version = "4.0.0-dev" source = "git+github.com/paritytech/…" [[package]] name = "frame-system" version = "4.0.0-dev" source = "git+github.com/paritytech/…" d Commented Sep 20, 2023 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.