feat: initialize Kurdistan SDK - independent fork of Polkadot SDK

This commit is contained in:
2025-12-13 15:44:15 +03:00
commit e4778b4576
6838 changed files with 1847450 additions and 0 deletions
@@ -0,0 +1,29 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
Block = Block1,
UncheckedExtrinsic = Uxt,
{}
}
fn main() {}
@@ -0,0 +1,5 @@
error: `Block` was declared above. Please use exactly one declaration for `Block`.
--> tests/construct_runtime_ui/abundant_where_param.rs:24:3
|
24 | Block = Block1,
| ^^^^^
@@ -0,0 +1,47 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use sp_runtime::{generic, traits::BlakeTwo256};
use sp_core::sr25519;
#[frame_support::pallet]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u64;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet exclude_parts { Pallet } use_parts { Pallet },
}
}
fn main() {}
@@ -0,0 +1,28 @@
error: Unexpected tokens, expected one of `=`, `,`
--> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:43:43
|
43 | Pallet: pallet exclude_parts { Pallet } use_parts { Pallet },
| ^^^^^^^^^
error[E0412]: cannot find type `RuntimeCall` in this scope
--> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:35:64
|
35 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
| ^^^^^^^^^^^ not found in this scope
|
help: you might be missing a type parameter
|
35 | pub type UncheckedExtrinsic<RuntimeCall> = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
| +++++++++++++
error[E0412]: cannot find type `Runtime` in this scope
--> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:37:25
|
37 | impl pallet::Config for Runtime {}
| ^^^^^^^ not found in this scope
|
help: there is an enum variant `sp_api::__private::TransactionType::Runtime`; try using the variant's enum
|
37 - impl pallet::Config for Runtime {}
37 + impl pallet::Config for sp_api::__private::TransactionType {}
|
@@ -0,0 +1,31 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
{
System: system::{},
Pallet1: pallet1::{} = 0,
}
}
fn main() {}
@@ -0,0 +1,11 @@
error: Pallet indices are conflicting: Both pallets System and Pallet1 are at index 0
--> tests/construct_runtime_ui/conflicting_index.rs:26:3
|
26 | System: system::{},
| ^^^^^^
error: Pallet indices are conflicting: Both pallets System and Pallet1 are at index 0
--> tests/construct_runtime_ui/conflicting_index.rs:27:3
|
27 | Pallet1: pallet1::{} = 0,
| ^^^^^^^
@@ -0,0 +1,33 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
{
System: system::{} = 5,
Pallet1: pallet1::{} = 3,
Pallet2: pallet2::{},
Pallet3: pallet3::{},
}
}
fn main() {}
@@ -0,0 +1,11 @@
error: Pallet indices are conflicting: Both pallets System and Pallet3 are at index 5
--> tests/construct_runtime_ui/conflicting_index_2.rs:26:3
|
26 | System: system::{} = 5,
| ^^^^^^
error: Pallet indices are conflicting: Both pallets System and Pallet3 are at index 5
--> tests/construct_runtime_ui/conflicting_index_2.rs:29:3
|
29 | Pallet3: pallet3::{},
| ^^^^^^^
@@ -0,0 +1,29 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
Balance: balances::{Pallet},
Balance: balances::{Pallet},
}
}
fn main() {}
@@ -0,0 +1,11 @@
error: Two pallets with the same name!
--> tests/construct_runtime_ui/conflicting_module_name.rs:24:3
|
24 | Balance: balances::{Pallet},
| ^^^^^^^
error: Two pallets with the same name!
--> tests/construct_runtime_ui/conflicting_module_name.rs:25:3
|
25 | Balance: balances::{Pallet},
| ^^^^^^^
@@ -0,0 +1,30 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = Uxt,
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
}
}
fn main() {}
@@ -0,0 +1,842 @@
error: use of deprecated constant `WhereSection::_w`:
It is deprecated to use a `where` clause in `construct_runtime`.
Please instead use `frame_system::Config` to set the `Block` type and delete this clause.
It is planned to be removed in December 2023.
For more info see:
<https://github.com/paritytech/substrate/pull/14437>
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^
|
= note: `-D deprecated` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(deprecated)]`
= note: this error originates in the macro `frame_support::match_and_insert` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
note: required by a bound in `frame_system::Event`
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub enum Event<T: Config> {
| ^^^^^^ required by this bound in `Event`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| ^ the trait `Config` is not implemented for `Runtime`
|
= note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `RawOrigin<_>: TryFrom<OriginCaller>` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `TryFrom<OriginCaller>` is not implemented for `RawOrigin<_>`
|
= help: the trait `TryFrom<OriginCaller>` is implemented for `RawOrigin<<Runtime as Config>::AccountId>`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= help: the trait `Callable<T>` is implemented for `Pallet<T>`
= note: required for `Pallet<Runtime>` to implement `Callable<Runtime>`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:26:3
|
26 | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
| ^^^^^^ the trait `Config` is not implemented for `Runtime`
|
note: required by a bound in `GenesisConfig`
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub struct GenesisConfig<T: Config> {
| ^^^^^^ required by this bound in `GenesisConfig`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
note: required by a bound in `frame_system::Event`
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub enum Event<T: Config> {
| ^^^^^^ required by this bound in `Event`
error[E0369]: binary operation `==` cannot be applied to type `&frame_system::Event<Runtime>`
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^
|
note: an implementation of `Config` might be missing for `Runtime`
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
| |______________________^ must implement `Config`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `PartialEq` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
note: required by a bound in `frame_system::Event`
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub enum Event<T: Config> {
| ^^^^^^ required by this bound in `Event`
error[E0277]: the trait bound `frame_system::Event<Runtime>: Encode` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Encode` is not implemented for `frame_system::Event<Runtime>`
|
= help: the trait `Encode` is implemented for `frame_system::Event<T>`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::codec::Encode` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
note: required by a bound in `frame_system::Event`
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub enum Event<T: Config> {
| ^^^^^^ required by this bound in `Event`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::codec::Encode` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `frame_system::Event<Runtime>: Decode` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Decode` is not implemented for `frame_system::Event<Runtime>`
|
= help: the trait `Decode` is implemented for `frame_system::Event<T>`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:26:11
|
26 | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
| ^^^^^^^^^^^^ the trait `Config` is not implemented for `Runtime`
|
note: required by a bound in `frame_system::Event`
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub enum Event<T: Config> {
| ^^^^^^ required by this bound in `Event`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= help: the trait `std::fmt::Debug` is implemented for `frame_system::Event<T>`
= note: required for `frame_system::Event<Runtime>` to implement `std::fmt::Debug`
= note: 1 redundant requirement hidden
= note: required for `&frame_system::Event<Runtime>` to implement `std::fmt::Debug`
= note: required for the cast from `&&frame_system::Event<Runtime>` to `&dyn std::fmt::Debug`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= help: the trait `std::fmt::Debug` is implemented for `frame_system::Error<T>`
= note: required for `frame_system::Error<Runtime>` to implement `std::fmt::Debug`
= note: 1 redundant requirement hidden
= note: required for `&frame_system::Error<Runtime>` to implement `std::fmt::Debug`
= note: required for the cast from `&&frame_system::Error<Runtime>` to `&dyn std::fmt::Debug`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:21:13
|
21 | pub struct Runtime where
| ^^^^^^^ the trait `Config` is not implemented for `Runtime`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= note: required for `RawOrigin<_>` to implement `Into<RuntimeOrigin>`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:26:11
|
26 | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
| ^^^^^^^^^^^^ the trait `Config` is not implemented for `Runtime`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= help: the trait `PalletInfoAccess` is implemented for `Pallet<T>`
= note: required for `Pallet<Runtime>` to implement `PalletInfoAccess`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= help: the trait `Callable<T>` is implemented for `Pallet<T>`
= note: required for `Pallet<Runtime>` to implement `Callable<Runtime>`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= help: the trait `Callable<T>` is implemented for `Pallet<T>`
= note: required for `Pallet<Runtime>` to implement `Callable<Runtime>`
error[E0369]: binary operation `==` cannot be applied to type `&frame_system::Call<Runtime>`
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^
|
note: an implementation of `Config` might be missing for `Runtime`
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
| |______________________^ must implement `Config`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `PartialEq` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `frame_system::Call<Runtime>: Encode` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Encode` is not implemented for `frame_system::Call<Runtime>`
|
= help: the trait `Encode` is implemented for `frame_system::Call<T>`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::codec::Encode` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
note: required by a bound in `frame_system::Call`
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| #[pallet::call(weight = <T as Config>::SystemWeightInfo)]
| ^^^^ required by this bound in `Call`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::codec::Encode` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `frame_system::Call<Runtime>: Decode` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Decode` is not implemented for `frame_system::Call<Runtime>`
|
= help: the trait `Decode` is implemented for `frame_system::Call<T>`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= help: the trait `Callable<T>` is implemented for `Pallet<T>`
= note: required for `Pallet<Runtime>` to implement `Callable<Runtime>`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::RuntimeDebug` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the method `get_dispatch_info` exists for reference `&Call<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ method cannot be called on `&Call<Runtime>` due to unsatisfied trait bounds
|
::: $WORKSPACE/substrate/frame/system/src/lib.rs
|
| #[pallet::call(weight = <T as Config>::SystemWeightInfo)]
| ---- doesn't satisfy `frame_system::Call<Runtime>: GetDispatchInfo`
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
which is required by `frame_system::Call<Runtime>: GetDispatchInfo`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the method `is_feeless` exists for reference `&Call<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ method cannot be called on `&Call<Runtime>` due to unsatisfied trait bounds
|
::: $WORKSPACE/substrate/frame/system/src/lib.rs
|
| #[pallet::call(weight = <T as Config>::SystemWeightInfo)]
| ---- doesn't satisfy `frame_system::Call<Runtime>: CheckIfFeeless`
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
which is required by `frame_system::Call<Runtime>: CheckIfFeeless`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the method `get_call_name` exists for reference `&Call<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ method cannot be called on `&Call<Runtime>` due to unsatisfied trait bounds
|
::: $WORKSPACE/substrate/frame/system/src/lib.rs
|
| #[pallet::call(weight = <T as Config>::SystemWeightInfo)]
| ---- doesn't satisfy `frame_system::Call<Runtime>: GetCallName`
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
which is required by `frame_system::Call<Runtime>: GetCallName`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:26:3
|
26 | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
| ^^^^^^ the trait `Config` is not implemented for `Runtime`
|
= help: the trait `ViewFunctionIdPrefix` is implemented for `Pallet<T>`
= note: required for `Pallet<Runtime>` to implement `ViewFunctionIdPrefix`
error[E0599]: the function or associated item `storage_metadata` exists for struct `Pallet<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ function or associated item cannot be called on `Pallet<Runtime>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the function or associated item `call_functions` exists for struct `Pallet<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ function or associated item cannot be called on `Pallet<Runtime>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the function or associated item `pallet_view_functions_metadata` exists for struct `Pallet<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ function or associated item cannot be called on `Pallet<Runtime>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the variant or associated item `event_metadata` exists for enum `Event<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ variant or associated item cannot be called on `Event<Runtime>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the function or associated item `pallet_constants_metadata` exists for struct `Pallet<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ function or associated item cannot be called on `Pallet<Runtime>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the function or associated item `error_metadata` exists for struct `Pallet<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ function or associated item cannot be called on `Pallet<Runtime>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the function or associated item `pallet_documentation_metadata` exists for struct `Pallet<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ function or associated item cannot be called on `Pallet<Runtime>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the function or associated item `pallet_associated_types_metadata` exists for struct `Pallet<Runtime>`, but its trait bounds were not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | construct_runtime! {
| __^
| | _|
| ||
21 | || pub struct Runtime where
| ||______________________- doesn't satisfy `Runtime: Config`
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |__^ function or associated item cannot be called on `Pallet<Runtime>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Runtime: Config`
note: the trait `Config` must be implemented
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub trait Config: 'static + Eq + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= help: the trait `Serialize` is implemented for `GenesisConfig<T>`
= note: required for `GenesisConfig<Runtime>` to implement `Serialize`
note: required by a bound in `frame_support::sp_runtime::serde::ser::SerializeStruct::serialize_field`
--> $CARGO/serde_core-1.0.228/src/ser/mod.rs
|
| fn serialize_field<T>(&mut self, key: &'static str, value: &T) -> Result<(), Self::Error>
| --------------- required by a bound in this associated function
| where
| T: ?Sized + Serialize;
| ^^^^^^^^^ required by this bound in `SerializeStruct::serialize_field`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
note: required by a bound in `GenesisConfig`
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub struct GenesisConfig<T: Config> {
| ^^^^^^ required by this bound in `GenesisConfig`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
note: required by a bound in `GenesisConfig`
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub struct GenesisConfig<T: Config> {
| ^^^^^^ required by this bound in `GenesisConfig`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::serde::Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
note: required by a bound in `GenesisConfig`
--> $WORKSPACE/substrate/frame/system/src/lib.rs
|
| pub struct GenesisConfig<T: Config> {
| ^^^^^^ required by this bound in `GenesisConfig`
error[E0277]: the trait bound `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ the trait `Config` is not implemented for `Runtime`
|
= help: the following other types implement trait `OnGenesis`:
()
(TupleElement0, TupleElement1)
(TupleElement0, TupleElement1, TupleElement2)
(TupleElement0, TupleElement1, TupleElement2, TupleElement3)
(TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
(TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
(TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
(TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
and $N others
= note: required for `Pallet<Runtime>` to implement `OnGenesis`
= note: 1 redundant requirement hidden
= note: required for `(Pallet<Runtime>,)` to implement `OnGenesis`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0282]: type annotations needed
--> tests/construct_runtime_ui/deprecated_where_block.rs:20:1
|
20 | / construct_runtime! {
21 | | pub struct Runtime where
22 | | Block = Block,
23 | | NodeBlock = Block,
... |
28 | | }
| |_^ cannot infer type
|
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -0,0 +1,28 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
Balance: balances::{Config, Call, Config<T>, Origin<T>},
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: `Config` was already declared before. Please remove the duplicate declaration
--> tests/construct_runtime_ui/double_module_parts.rs:24:37
|
24 | Balance: balances::{Config, Call, Config<T>, Origin<T>},
| ^^^^^^
@@ -0,0 +1,30 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
{
System: frame_system exclude_parts { Call, Call },
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: `Call` was already declared before. Please remove the duplicate declaration
--> tests/construct_runtime_ui/duplicate_exclude.rs:26:46
|
26 | System: frame_system exclude_parts { Call, Call },
| ^^^^
@@ -0,0 +1,27 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
system: ,
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: expected one of: `crate`, `self`, `super`, identifier
--> tests/construct_runtime_ui/empty_pallet_path.rs:23:11
|
23 | system: ,
| ^
@@ -0,0 +1,30 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
{
System: frame_system exclude_part { Call },
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,`
--> tests/construct_runtime_ui/exclude_missspell.rs:26:24
|
26 | System: frame_system exclude_part { Call },
| ^^^^^^^^^^^^
@@ -0,0 +1,52 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use sp_runtime::{generic, traits::BlakeTwo256};
use sp_core::sr25519;
#[frame_support::pallet]
mod pallet {
use frame_support::pallet_prelude::*;
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pallet::storage]
type Foo<T> = StorageValue<Value=u8>;
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u64;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet exclude_parts { Call },
}
}
fn main() {}
@@ -0,0 +1,28 @@
error: Invalid pallet part specified, the pallet `Pallet` doesn't have the `Call` part. Available parts are: `Pallet`, `Storage`.
--> tests/construct_runtime_ui/exclude_undefined_part.rs:48:34
|
48 | Pallet: pallet exclude_parts { Call },
| ^^^^
error[E0412]: cannot find type `RuntimeCall` in this scope
--> tests/construct_runtime_ui/exclude_undefined_part.rs:40:64
|
40 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
| ^^^^^^^^^^^ not found in this scope
|
help: you might be missing a type parameter
|
40 | pub type UncheckedExtrinsic<RuntimeCall> = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
| +++++++++++++
error[E0412]: cannot find type `Runtime` in this scope
--> tests/construct_runtime_ui/exclude_undefined_part.rs:42:25
|
42 | impl pallet::Config for Runtime {}
| ^^^^^^^ not found in this scope
|
help: there is an enum variant `sp_api::__private::TransactionType::Runtime`; try using the variant's enum
|
42 - impl pallet::Config for Runtime {}
42 + impl pallet::Config for sp_api::__private::TransactionType {}
|
@@ -0,0 +1,28 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
#[cfg(test)]
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: `System` pallet declaration is feature gated, please remove any `#[cfg]` attributes
--> tests/construct_runtime_ui/feature_gated_system_pallet.rs:24:3
|
24 | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
| ^^^^^^
@@ -0,0 +1,28 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
Balance: balances::<Instance1>::{Call<T>, Origin<T>},
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: `Call` is not allowed to have generics. Only the following pallets are allowed to have generics: `Event`, `Error`, `Origin`, `Config`, `Task`.
--> tests/construct_runtime_ui/generics_in_invalid_module.rs:24:36
|
24 | Balance: balances::<Instance1>::{Call<T>, Origin<T>},
| ^^^^
@@ -0,0 +1,29 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
#[cfg(feature = 1)]
Balance: balances::{Config, Call},
}
}
fn main() {}
@@ -0,0 +1,6 @@
error: feature = 1
^ expected one of `<key>`, `all`, `any`, `not` here
--> tests/construct_runtime_ui/invalid_meta_literal.rs:24:3
|
24 | #[cfg(feature = 1)]
| ^
@@ -0,0 +1,27 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
system: System::(),
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,`
--> tests/construct_runtime_ui/invalid_module_details.rs:23:17
|
23 | system: System::(),
| ^
@@ -0,0 +1,27 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
system: System::{enum},
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: expected one of: `Pallet`, `Call`, `Storage`, `Event`, `Error`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned`, `FreezeReason`, `HoldReason`, `Task`, `LockId`, `SlashReason`
--> tests/construct_runtime_ui/invalid_module_details_keyword.rs:23:20
|
23 | system: System::{enum},
| ^^^^
@@ -0,0 +1,28 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
Balance: balances::{Unexpected},
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: expected one of: `Pallet`, `Call`, `Storage`, `Event`, `Error`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned`, `FreezeReason`, `HoldReason`, `Task`, `LockId`, `SlashReason`
--> tests/construct_runtime_ui/invalid_module_entry.rs:24:23
|
24 | Balance: balances::{Unexpected},
| ^^^^^^^^^^
@@ -0,0 +1,27 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
system: System ?
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,`
--> tests/construct_runtime_ui/invalid_token_after_module.rs:23:18
|
23 | system: System ?
| ^
@@ -0,0 +1,27 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
system ?
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: expected `:`
--> tests/construct_runtime_ui/invalid_token_after_name.rs:23:10
|
23 | system ?
| ^
@@ -0,0 +1,29 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
TypeX = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{}
}
fn main() {}
@@ -0,0 +1,5 @@
error: expected one of: `Block`, `NodeBlock`, `UncheckedExtrinsic`
--> tests/construct_runtime_ui/invalid_where_param.rs:24:3
|
24 | TypeX = Block,
| ^^^^^
@@ -0,0 +1,28 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system expanded::{}::{Pallet},
Balance: balances::<Instance1> expanded::{}::{Event},
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: Instantiable pallet with no generic `Event` cannot be constructed: pallet `Balance` must have generic `Event`
--> tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.rs:24:3
|
24 | Balance: balances::<Instance1> expanded::{}::{Event},
| ^^^^^^^
@@ -0,0 +1,27 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
system: System::<>,
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: expected identifier
--> tests/construct_runtime_ui/missing_module_instance.rs:23:20
|
23 | system: System::<>,
| ^
@@ -0,0 +1,28 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system expanded::{}::{Pallet},
Balance: balances::<Instance1> expanded::{}::{Origin},
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: Instantiable pallet with no generic `Origin` cannot be constructed: pallet `Balance` must have generic `Origin`
--> tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.rs:24:3
|
24 | Balance: balances::<Instance1> expanded::{}::{Origin},
| ^^^^^^^
@@ -0,0 +1,26 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
}
}
fn main() {}
@@ -0,0 +1,6 @@
error: `System` pallet declaration is missing. Please add this line: `System: frame_system,`
--> tests/construct_runtime_ui/missing_system_module.rs:22:2
|
22 | / {
23 | | }
| |_____^
@@ -0,0 +1,27 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
{}
}
fn main() {}
@@ -0,0 +1,5 @@
error: Missing associated type for `UncheckedExtrinsic`. Add `UncheckedExtrinsic` = ... to where section.
--> tests/construct_runtime_ui/missing_where_param.rs:24:2
|
24 | {}
| ^
@@ -0,0 +1,31 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic,
Block = Block,
NodeBlock = Block,
{
System: system::{} = 255,
Pallet256: pallet256::{},
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: Pallet index doesn't fit into u8, index is 256
--> tests/construct_runtime_ui/more_than_256_modules.rs:27:3
|
27 | Pallet256: pallet256::{},
| ^^^^^^^^^
@@ -0,0 +1,30 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
UncheckedExtrinsic = UncheckedExtrinsic
Block = Block,
NodeBlock = Block,
{
System: system,
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: Expected `,` or `{`
--> tests/construct_runtime_ui/no_comma_after_where.rs:23:3
|
23 | Block = Block,
| ^^^^^
@@ -0,0 +1,183 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
#[frame_support::pallet]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u32;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Nonce = u64;
type RuntimeCall = RuntimeCall;
type Hash = sp_runtime::testing::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
construct_runtime! {
pub struct Runtime
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet1: pallet::{Pallet},
Pallet2: pallet::{Pallet},
Pallet3: pallet::{Pallet},
Pallet4: pallet::{Pallet},
Pallet5: pallet::{Pallet},
Pallet6: pallet::{Pallet},
Pallet7: pallet::{Pallet},
Pallet8: pallet::{Pallet},
Pallet9: pallet::{Pallet},
Pallet10: pallet::{Pallet},
Pallet11: pallet::{Pallet},
Pallet12: pallet::{Pallet},
Pallet13: pallet::{Pallet},
Pallet14: pallet::{Pallet},
Pallet15: pallet::{Pallet},
Pallet16: pallet::{Pallet},
Pallet17: pallet::{Pallet},
Pallet18: pallet::{Pallet},
Pallet19: pallet::{Pallet},
Pallet20: pallet::{Pallet},
Pallet21: pallet::{Pallet},
Pallet22: pallet::{Pallet},
Pallet23: pallet::{Pallet},
Pallet24: pallet::{Pallet},
Pallet25: pallet::{Pallet},
Pallet26: pallet::{Pallet},
Pallet27: pallet::{Pallet},
Pallet28: pallet::{Pallet},
Pallet29: pallet::{Pallet},
Pallet30: pallet::{Pallet},
Pallet31: pallet::{Pallet},
Pallet32: pallet::{Pallet},
Pallet33: pallet::{Pallet},
Pallet34: pallet::{Pallet},
Pallet35: pallet::{Pallet},
Pallet36: pallet::{Pallet},
Pallet37: pallet::{Pallet},
Pallet38: pallet::{Pallet},
Pallet39: pallet::{Pallet},
Pallet40: pallet::{Pallet},
Pallet41: pallet::{Pallet},
Pallet42: pallet::{Pallet},
Pallet43: pallet::{Pallet},
Pallet44: pallet::{Pallet},
Pallet45: pallet::{Pallet},
Pallet46: pallet::{Pallet},
Pallet47: pallet::{Pallet},
Pallet48: pallet::{Pallet},
Pallet49: pallet::{Pallet},
Pallet50: pallet::{Pallet},
Pallet51: pallet::{Pallet},
Pallet52: pallet::{Pallet},
Pallet53: pallet::{Pallet},
Pallet54: pallet::{Pallet},
Pallet55: pallet::{Pallet},
Pallet56: pallet::{Pallet},
Pallet57: pallet::{Pallet},
Pallet58: pallet::{Pallet},
Pallet59: pallet::{Pallet},
Pallet60: pallet::{Pallet},
Pallet61: pallet::{Pallet},
Pallet62: pallet::{Pallet},
Pallet63: pallet::{Pallet},
Pallet64: pallet::{Pallet},
Pallet65: pallet::{Pallet},
Pallet66: pallet::{Pallet},
Pallet67: pallet::{Pallet},
Pallet68: pallet::{Pallet},
Pallet69: pallet::{Pallet},
Pallet70: pallet::{Pallet},
Pallet71: pallet::{Pallet},
Pallet72: pallet::{Pallet},
Pallet73: pallet::{Pallet},
Pallet74: pallet::{Pallet},
Pallet75: pallet::{Pallet},
Pallet76: pallet::{Pallet},
Pallet77: pallet::{Pallet},
Pallet78: pallet::{Pallet},
Pallet79: pallet::{Pallet},
Pallet80: pallet::{Pallet},
Pallet81: pallet::{Pallet},
Pallet82: pallet::{Pallet},
Pallet83: pallet::{Pallet},
Pallet84: pallet::{Pallet},
Pallet85: pallet::{Pallet},
Pallet86: pallet::{Pallet},
Pallet87: pallet::{Pallet},
Pallet88: pallet::{Pallet},
Pallet89: pallet::{Pallet},
Pallet90: pallet::{Pallet},
Pallet91: pallet::{Pallet},
Pallet92: pallet::{Pallet},
Pallet93: pallet::{Pallet},
Pallet94: pallet::{Pallet},
Pallet95: pallet::{Pallet},
Pallet96: pallet::{Pallet},
Pallet97: pallet::{Pallet},
Pallet98: pallet::{Pallet},
Pallet99: pallet::{Pallet},
Pallet100: pallet::{Pallet},
Pallet101: pallet::{Pallet},
Pallet102: pallet::{Pallet},
Pallet103: pallet::{Pallet},
Pallet104: pallet::{Pallet},
Pallet105: pallet::{Pallet},
Pallet106: pallet::{Pallet},
Pallet107: pallet::{Pallet},
Pallet108: pallet::{Pallet},
Pallet109: pallet::{Pallet},
Pallet110: pallet::{Pallet},
}
}
fn main() {}
@@ -0,0 +1,19 @@
error: The number of pallets exceeds the maximum number of tuple elements. To increase this limit, enable the tuples-96 feature of [frame_support].
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:67:2
|
67 | pub struct Runtime
| ^^^
error: recursion limit reached while expanding `frame_support::__private::tt_return!`
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:66:1
|
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
181 | | }
| |_^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`$CRATE`)
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -0,0 +1,123 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
#[frame_support::pallet]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pallet::error]
pub enum Error<T> {
MyError(crate::Nested1),
}
}
#[derive(
scale_info::TypeInfo,
frame_support::PalletError,
codec::Encode,
codec::Decode,
codec::DecodeWithMemTracking,
)]
pub enum Nested1 {
Nested2(Nested2),
}
#[derive(
scale_info::TypeInfo,
frame_support::PalletError,
codec::Encode,
codec::Decode,
codec::DecodeWithMemTracking,
)]
pub enum Nested2 {
Nested3(Nested3),
}
#[derive(
scale_info::TypeInfo,
frame_support::PalletError,
codec::Encode,
codec::Decode,
codec::DecodeWithMemTracking,
)]
pub enum Nested3 {
Nested4(Nested4),
}
#[derive(
scale_info::TypeInfo,
frame_support::PalletError,
codec::Encode,
codec::Decode,
codec::DecodeWithMemTracking,
)]
pub enum Nested4 {
Num(u8),
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u32;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Nonce = u64;
type RuntimeCall = RuntimeCall;
type Hash = sp_runtime::testing::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
construct_runtime! {
pub struct Runtime
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet::{Pallet},
}
}
fn main() {}
@@ -0,0 +1,12 @@
error[E0080]: evaluation of constant value failed
--> tests/construct_runtime_ui/pallet_error_too_large.rs:115:1
|
115 | / construct_runtime! {
116 | | pub struct Runtime
117 | | {
118 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
121 | | }
| |_^ evaluation panicked: The maximum encoded size of the error type in the `Pallet` pallet exceeds `MAX_MODULE_ERROR_ENCODED_SIZE`
|
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -0,0 +1,80 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#![cfg_attr(not(feature = "std"), no_std)]
use frame_support::derive_impl;
pub use pallet::*;
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use frame_support::pallet_prelude::*;
// The struct on which we build all of our Pallet logic.
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
// Your Pallet's configuration trait, representing custom external types and interfaces.
#[pallet::config]
pub trait Config<I: 'static = ()>: frame_system::Config {}
#[pallet::composite_enum]
pub enum HoldReason<I: 'static = ()> {
SomeHoldReason
}
#[pallet::composite_enum]
pub enum FreezeReason<I: 'static = ()> {
SomeFreezeReason
}
#[pallet::composite_enum]
pub enum SlashReason<I: 'static = ()> {
SomeSlashReason
}
#[pallet::composite_enum]
pub enum LockId<I: 'static = ()> {
SomeLockId
}
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type Block = Block;
}
pub type Header = sp_runtime::generic::Header<u64, sp_runtime::traits::BlakeTwo256>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u64, RuntimeCall, (), ()>;
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
frame_support::construct_runtime!(
pub enum Runtime
{
// Exclude part `Storage` in order not to check its metadata in tests.
System: frame_system,
Pallet1: pallet,
Pallet2: pallet::<Instance2>,
}
);
impl pallet::Config for Runtime {}
impl pallet::Config<pallet::Instance2> for Runtime {}
fn main() {}
@@ -0,0 +1,74 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
#[frame_support::pallet]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u32;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Nonce = u64;
type RuntimeCall = RuntimeCall;
type Hash = sp_runtime::testing::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
construct_runtime! {
pub struct Runtime
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet::{Pallet, Call},
}
}
fn main() {}
@@ -0,0 +1,15 @@
error: `Pallet` does not have #[pallet::call] defined, perhaps you should remove `Call` from construct_runtime?
--> tests/construct_runtime_ui/undefined_call_part.rs:22:1
|
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_call_check::is_call_part_defined` which comes from the expansion of the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -0,0 +1,74 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
#[frame_support::pallet]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u32;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Nonce = u64;
type RuntimeCall = RuntimeCall;
type Hash = sp_runtime::testing::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
construct_runtime! {
pub struct Runtime
{
System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Event},
}
}
fn main() {}
@@ -0,0 +1,53 @@
error: `Pallet` does not have #[pallet::event] defined, perhaps you should remove `Event` from construct_runtime?
--> tests/construct_runtime_ui/undefined_event_part.rs:22:1
|
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_event_check::is_event_part_defined` 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 `Event` in module `pallet`
--> tests/construct_runtime_ui/undefined_event_part.rs:66:1
|
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these enums
|
18 + use frame_support_test::Event;
|
18 + use frame_system::Event;
|
error[E0433]: failed to resolve: could not find `Event` in `pallet`
--> tests/construct_runtime_ui/undefined_event_part.rs:66:1
|
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ could not find `Event` in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these enums
|
18 + use frame_support_test::Event;
|
18 + use frame_system::Event;
|
@@ -0,0 +1,74 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
#[frame_support::pallet]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u32;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Nonce = u64;
type RuntimeCall = RuntimeCall;
type Hash = sp_runtime::testing::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
construct_runtime! {
pub struct Runtime
{
System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Config},
}
}
fn main() {}
@@ -0,0 +1,34 @@
error: `Pallet` does not have #[pallet::genesis_config] defined, perhaps you should remove `Config` from construct_runtime?
--> tests/construct_runtime_ui/undefined_genesis_config_part.rs:22:1
|
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_genesis_config_check::is_genesis_config_defined` 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 `GenesisConfig` in module `pallet`
--> tests/construct_runtime_ui/undefined_genesis_config_part.rs:66:1
|
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these structs
|
18 + use frame_system::GenesisConfig;
|
18 + use test_pallet::GenesisConfig;
|
@@ -0,0 +1,74 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
#[frame_support::pallet]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u32;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Nonce = u64;
type RuntimeCall = RuntimeCall;
type Hash = sp_runtime::testing::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
construct_runtime! {
pub struct Runtime
{
System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Inherent},
}
}
fn main() {}
@@ -0,0 +1,136 @@
error: `Pallet` does not have #[pallet::inherent] defined, perhaps you should remove `Inherent` from construct_runtime?
--> tests/construct_runtime_ui/undefined_inherent_part.rs:22:1
|
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_inherent_check::is_inherent_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no function or associated item named `create_inherent` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `create_inherent` not found for this struct
...
66 | construct_runtime! {
| _^
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ function or associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `create_inherent`, perhaps you need to implement one of them:
candidate #1: `CreateBare`
candidate #2: `ProvideInherent`
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no function or associated item named `is_inherent` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `is_inherent` not found for this struct
...
66 | construct_runtime! {
| _^
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ function or associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `is_inherent`, perhaps you need to implement one of them:
candidate #1: `IsInherent`
candidate #2: `ProvideInherent`
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no function or associated item named `check_inherent` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `check_inherent` not found for this struct
...
66 | construct_runtime! {
| _^
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ function or associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `check_inherent`, perhaps you need to implement it:
candidate #1: `ProvideInherent`
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- associated item `INHERENT_IDENTIFIER` not found for this struct
...
66 | construct_runtime! {
| _^
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `INHERENT_IDENTIFIER`, perhaps you need to implement it:
candidate #1: `ProvideInherent`
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no function or associated item named `is_inherent_required` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `is_inherent_required` not found for this struct
...
66 | construct_runtime! {
| _^
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ function or associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `is_inherent_required`, perhaps you need to implement it:
candidate #1: `ProvideInherent`
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `pallet::Pallet<Runtime>: ProvideInherent` is not satisfied
--> tests/construct_runtime_ui/undefined_inherent_part.rs:70:3
|
70 | Pallet: pallet expanded::{}::{Pallet, Inherent},
| ^^^^^^ the trait `ProvideInherent` is not implemented for `pallet::Pallet<Runtime>`
error[E0277]: the trait bound `pallet::Pallet<Runtime>: ProvideInherent` is not satisfied
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ the trait `ProvideInherent` is not implemented for `pallet::Pallet<Runtime>`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -0,0 +1,74 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
#[frame_support::pallet]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u32;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Nonce = u64;
type RuntimeCall = RuntimeCall;
type Hash = sp_runtime::testing::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
construct_runtime! {
pub struct Runtime
{
System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Origin},
}
}
fn main() {}
@@ -0,0 +1,34 @@
error: `Pallet` does not have #[pallet::origin] defined, perhaps you should remove `Origin` from construct_runtime?
--> tests/construct_runtime_ui/undefined_origin_part.rs:22:1
|
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_origin_check::is_origin_part_defined` 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 `Origin` in module `pallet`
--> tests/construct_runtime_ui/undefined_origin_part.rs:66:1
|
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these type aliases
|
18 + use frame_support_test::Origin;
|
18 + use frame_system::Origin;
|
@@ -0,0 +1,74 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
#[frame_support::pallet]
mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u32;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Nonce = u64;
type RuntimeCall = RuntimeCall;
type Hash = sp_runtime::testing::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
construct_runtime! {
pub struct Runtime
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet::{Pallet, ValidateUnsigned},
}
}
fn main() {}
@@ -0,0 +1,72 @@
error: `Pallet` does not have #[pallet::validate_unsigned] defined, perhaps you should remove `ValidateUnsigned` from construct_runtime?
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:22:1
|
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_validate_unsigned_check::is_validate_unsigned_part_defined` which comes from the expansion of the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no variant or associated item named `Pallet` found for enum `RuntimeCall` in the current scope
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:70:3
|
66 | // construct_runtime! {
67 | || pub struct Runtime
68 | || {
69 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | || Pallet: pallet::{Pallet, ValidateUnsigned},
| || ----^^^^^^ variant or associated item not found in `RuntimeCall`
| ||_____|
| |
71 | | }
72 | | }
| |__- variant or associated item `Pallet` not found for this enum
error[E0599]: no function or associated item named `pre_dispatch` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `pre_dispatch` not found for this struct
...
66 | construct_runtime! {
| _^
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ function or associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `pre_dispatch`, perhaps you need to implement one of them:
candidate #1: `SignedExtension`
candidate #2: `ValidateUnsigned`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no function or associated item named `validate_unsigned` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `validate_unsigned` not found for this struct
...
66 | construct_runtime! {
| _^
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
... |
72 | | }
| |_^ function or associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `validate_unsigned`, perhaps you need to implement one of them:
candidate #1: `SignedExtension`
candidate #2: `ValidateUnsigned`
= note: this error originates in the macro `frame_support::construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -0,0 +1,29 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
#[cfg(feature(test))]
Balance: balances::{Config, Call},
}
}
fn main() {}
@@ -0,0 +1,6 @@
error: feature(test)
^ expected one of `=`, `,`, `)` here
--> tests/construct_runtime_ui/unsupported_meta_structure.rs:24:3
|
24 | #[cfg(feature(test))]
| ^
@@ -0,0 +1,29 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet},
#[attr]
Balance: balances::{Config, Call},
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: Unsupported attribute, only #[cfg] is supported on pallet declarations in `construct_runtime`
--> tests/construct_runtime_ui/unsupported_pallet_attr.rs:24:3
|
24 | #[attr]
| ^
@@ -0,0 +1,52 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use sp_runtime::{generic, traits::BlakeTwo256};
use sp_core::sr25519;
#[frame_support::pallet]
mod pallet {
use frame_support::pallet_prelude::*;
#[pallet::config]
pub trait Config: frame_system::Config {}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pallet::storage]
type Foo<T> = StorageValue<Value=u8>;
}
pub type Signature = sr25519::Signature;
pub type BlockNumber = u64;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
impl pallet::Config for Runtime {}
construct_runtime! {
pub struct Runtime
{
System: system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet use_parts { Call },
}
}
fn main() {}
@@ -0,0 +1,28 @@
error: Invalid pallet part specified, the pallet `Pallet` doesn't have the `Call` part. Available parts are: `Pallet`, `Storage`.
--> tests/construct_runtime_ui/use_undefined_part.rs:48:30
|
48 | Pallet: pallet use_parts { Call },
| ^^^^
error[E0412]: cannot find type `RuntimeCall` in this scope
--> tests/construct_runtime_ui/use_undefined_part.rs:40:64
|
40 | pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
| ^^^^^^^^^^^ not found in this scope
|
help: you might be missing a type parameter
|
40 | pub type UncheckedExtrinsic<RuntimeCall> = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
| +++++++++++++
error[E0412]: cannot find type `Runtime` in this scope
--> tests/construct_runtime_ui/use_undefined_part.rs:42:25
|
42 | impl pallet::Config for Runtime {}
| ^^^^^^^ not found in this scope
|
help: there is an enum variant `sp_api::__private::TransactionType::Runtime`; try using the variant's enum
|
42 - impl pallet::Config for Runtime {}
42 + impl pallet::Config for sp_api::__private::TransactionType {}
|