Moves Block to frame_system instead of construct_runtime and removes Header and BlockNumber (#14437)

* Initial setup

* Adds node block

* Uses UncheckedExtrinsic and removes Where section

* Updates frame_system to use Block

* Adds deprecation warning

* Fixes pallet-timestamp

* Removes Header and BlockNumber

* Addresses review comments

* Addresses review comments

* Adds comment about compiler bug

* Removes where clause

* Refactors code

* Fixes errors in cargo check

* Fixes errors in cargo check

* Fixes warnings in cargo check

* Formatting

* Fixes construct_runtime tests

* Uses import instead of full path for BlockNumber

* Uses import instead of full path for Header

* Formatting

* Fixes construct_runtime tests

* Fixes imports in benchmarks

* Formatting

* Fixes construct_runtime tests

* Formatting

* Minor updates

* Fixes construct_runtime ui tests

* Fixes construct_runtime ui tests with 1.70

* Fixes docs

* Fixes docs

* Adds u128 mock block type

* Fixes split example

* fixes for cumulus

* ".git/.scripts/commands/fmt/fmt.sh"

* Updates new tests

* Fixes fully-qualified path in few places

* Formatting

* Update frame/examples/default-config/src/lib.rs

Co-authored-by: Juan <juangirini@gmail.com>

* Update frame/support/procedural/src/construct_runtime/mod.rs

Co-authored-by: Juan <juangirini@gmail.com>

* ".git/.scripts/commands/fmt/fmt.sh"

* Addresses some review comments

* Fixes build

* ".git/.scripts/commands/fmt/fmt.sh"

* Update frame/democracy/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/democracy/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/support/procedural/src/construct_runtime/mod.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/support/procedural/src/construct_runtime/mod.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Addresses review comments

* Updates trait bounds

* Minor fix

* ".git/.scripts/commands/fmt/fmt.sh"

* Removes unnecessary bound

* ".git/.scripts/commands/fmt/fmt.sh"

* Updates test

* Fixes build

* Adds a bound for header

* ".git/.scripts/commands/fmt/fmt.sh"

* Removes where block

* Minor fix

* Minor fix

* Fixes tests

* ".git/.scripts/commands/update-ui/update-ui.sh" 1.70

* Updates test

* Update primitives/runtime/src/traits.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update primitives/runtime/src/traits.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Updates doc

* Updates doc

---------

Co-authored-by: command-bot <>
Co-authored-by: Juan <juangirini@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
gupnik
2023-07-13 17:31:34 +05:30
committed by GitHub
parent e42a669c50
commit 5e7b27e98c
277 changed files with 2017 additions and 2450 deletions
@@ -22,9 +22,13 @@
#![recursion_limit = "128"]
use codec::MaxEncodedLen;
use frame_support::{parameter_types, traits::PalletInfo as _};
use frame_support::{
derive_impl, parameter_types, traits::PalletInfo as _, weights::RuntimeDbWeight,
};
use frame_system::limits::{BlockLength, BlockWeights};
use scale_info::TypeInfo;
use sp_core::sr25519;
use sp_api::RuntimeVersion;
use sp_core::{sr25519, ConstU64};
use sp_runtime::{
generic,
traits::{BlakeTwo256, Verify},
@@ -37,9 +41,8 @@ parameter_types! {
#[frame_support::pallet(dev_mode)]
mod module1 {
use self::frame_system::pallet_prelude::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
use frame_system::pallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T, I = ()>(_);
@@ -75,10 +78,9 @@ mod module1 {
#[frame_support::pallet(dev_mode)]
mod module2 {
use self::frame_system::pallet_prelude::*;
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
use frame_system::pallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
@@ -122,10 +124,9 @@ mod nested {
#[frame_support::pallet(dev_mode)]
pub mod module3 {
use self::frame_system::pallet_prelude::*;
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
use frame_system::pallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
@@ -180,10 +181,9 @@ mod nested {
#[frame_support::pallet(dev_mode)]
pub mod module3 {
use self::frame_system::pallet_prelude::*;
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
use frame_system::pallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
@@ -256,15 +256,10 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
use frame_support_test as system;
frame_support::construct_runtime!(
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet, Call, Event<T>, Origin<T>} = 30,
System: frame_system::{Pallet, Call, Event<T>, Origin<T>} = 30,
Module1_1: module1::<Instance1>::{Pallet, Call, Storage, Event<T>, Origin<T>},
Module2: module2::{Pallet, Call, Storage, Event<T>, Origin},
Module1_2: module1::<Instance2>::{Pallet, Call, Storage, Event<T>, Origin<T>},
@@ -280,15 +275,18 @@ frame_support::construct_runtime!(
}
);
impl frame_support_test::Config for Runtime {
type BlockNumber = BlockNumber;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type AccountId = AccountId;
type Lookup = sp_runtime::traits::IdentityLookup<AccountId>;
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type PalletInfo = PalletInfo;
type DbWeight = ();
type OnSetCode = ();
type Block = Block;
type BlockHashCount = ConstU64<10>;
}
impl module1::Config<module1::Instance1> for Runtime {
@@ -336,7 +334,7 @@ fn test_pub() -> AccountId {
fn check_modules_error_type() {
sp_io::TestExternalities::default().execute_with(|| {
assert_eq!(
Module1_1::fail(system::Origin::<Runtime>::Root.into()),
Module1_1::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 31,
error: [0; 4],
@@ -344,7 +342,7 @@ fn check_modules_error_type() {
})),
);
assert_eq!(
Module2::fail(system::Origin::<Runtime>::Root.into()),
Module2::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 32,
error: [0; 4],
@@ -352,7 +350,7 @@ fn check_modules_error_type() {
})),
);
assert_eq!(
Module1_2::fail(system::Origin::<Runtime>::Root.into()),
Module1_2::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 33,
error: [0; 4],
@@ -360,7 +358,7 @@ fn check_modules_error_type() {
})),
);
assert_eq!(
NestedModule3::fail(system::Origin::<Runtime>::Root.into()),
NestedModule3::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 34,
error: [0; 4],
@@ -368,7 +366,7 @@ fn check_modules_error_type() {
})),
);
assert_eq!(
Module1_3::fail(system::Origin::<Runtime>::Root.into()),
Module1_3::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 6,
error: [0; 4],
@@ -376,7 +374,7 @@ fn check_modules_error_type() {
})),
);
assert_eq!(
Module1_4::fail(system::Origin::<Runtime>::Root.into()),
Module1_4::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 3,
error: [0; 4],
@@ -384,7 +382,7 @@ fn check_modules_error_type() {
})),
);
assert_eq!(
Module1_5::fail(system::Origin::<Runtime>::Root.into()),
Module1_5::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 4,
error: [0; 4],
@@ -392,7 +390,7 @@ fn check_modules_error_type() {
})),
);
assert_eq!(
Module1_6::fail(system::Origin::<Runtime>::Root.into()),
Module1_6::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 1,
error: [0; 4],
@@ -400,7 +398,7 @@ fn check_modules_error_type() {
})),
);
assert_eq!(
Module1_7::fail(system::Origin::<Runtime>::Root.into()),
Module1_7::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 2,
error: [0; 4],
@@ -408,7 +406,7 @@ fn check_modules_error_type() {
})),
);
assert_eq!(
Module1_8::fail(system::Origin::<Runtime>::Root.into()),
Module1_8::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 12,
error: [0; 4],
@@ -416,7 +414,7 @@ fn check_modules_error_type() {
})),
);
assert_eq!(
Module1_9::fail(system::Origin::<Runtime>::Root.into()),
Module1_9::fail(frame_system::Origin::<Runtime>::Root.into()),
Err(DispatchError::Module(ModuleError {
index: 13,
error: [0; 4],
@@ -436,7 +434,7 @@ fn integrity_test_works() {
fn origin_codec() {
use codec::Encode;
let origin = OriginCaller::system(system::RawOrigin::None);
let origin = OriginCaller::system(frame_system::RawOrigin::None);
assert_eq!(origin.encode()[0], 30);
let origin = OriginCaller::Module1_1(module1::Origin(Default::default()));
@@ -471,7 +469,8 @@ fn origin_codec() {
fn event_codec() {
use codec::Encode;
let event = system::Event::<Runtime>::ExtrinsicSuccess;
let event =
frame_system::Event::<Runtime>::ExtrinsicSuccess { dispatch_info: Default::default() };
assert_eq!(RuntimeEvent::from(event).encode()[0], 30);
let event = module1::Event::<Runtime, module1::Instance1>::A(test_pub());
@@ -508,7 +507,7 @@ fn event_codec() {
#[test]
fn call_codec() {
use codec::Encode;
assert_eq!(RuntimeCall::System(system::Call::noop {}).encode()[0], 30);
assert_eq!(RuntimeCall::System(frame_system::Call::remark { remark: vec![1] }).encode()[0], 30);
assert_eq!(RuntimeCall::Module1_1(module1::Call::fail {}).encode()[0], 31);
assert_eq!(RuntimeCall::Module2(module2::Call::fail {}).encode()[0], 32);
assert_eq!(RuntimeCall::Module1_2(module1::Call::fail {}).encode()[0], 33);
@@ -639,15 +638,67 @@ fn call_subtype_conversion() {
fn test_metadata() {
use frame_support::metadata::{v14::*, *};
use scale_info::meta_type;
use sp_core::Encode;
fn maybe_docs(doc: Vec<&'static str>) -> Vec<&'static str> {
if cfg!(feature = "no-metadata-docs") {
vec![]
} else {
doc
}
}
let pallets = vec![
PalletMetadata {
name: "System",
storage: None,
calls: Some(meta_type::<system::Call<Runtime>>().into()),
event: Some(meta_type::<system::Event<Runtime>>().into()),
constants: vec![],
error: Some(meta_type::<system::Error<Runtime>>().into()),
calls: Some(meta_type::<frame_system::Call<Runtime>>().into()),
event: Some(meta_type::<frame_system::Event<Runtime>>().into()),
constants: vec![
PalletConstantMetadata {
name: "BlockWeights",
ty: meta_type::<BlockWeights>(),
value: BlockWeights::default().encode(),
docs: maybe_docs(vec![" Block & extrinsics weights: base values and limits."]),
},
PalletConstantMetadata {
name: "BlockLength",
ty: meta_type::<BlockLength>(),
value: BlockLength::default().encode(),
docs: maybe_docs(vec![" The maximum length of a block (in bytes)."]),
},
PalletConstantMetadata {
name: "BlockHashCount",
ty: meta_type::<u64>(),
value: 10u64.encode(),
docs: maybe_docs(vec![" Maximum number of block number to block hash mappings to keep (oldest pruned first)."]),
},
PalletConstantMetadata {
name: "DbWeight",
ty: meta_type::<RuntimeDbWeight>(),
value: RuntimeDbWeight::default().encode(),
docs: maybe_docs(vec![" The weight of runtime database operations the runtime can invoke.",]),
},
PalletConstantMetadata {
name: "Version",
ty: meta_type::<RuntimeVersion>(),
value: RuntimeVersion::default().encode(),
docs: maybe_docs(vec![ " Get the chain's current version."]),
},
PalletConstantMetadata {
name: "SS58Prefix",
ty: meta_type::<u16>(),
value: 0u16.encode(),
docs: maybe_docs(vec![
" The designated SS58 prefix of this chain.",
"",
" This replaces the \"ss58Format\" property declared in the chain spec. Reason is",
" that the runtime should know about the prefix in order to make use of it as",
" an identifier of the chain.",
]),
},
],
error: Some(meta_type::<frame_system::Error<Runtime>>().into()),
index: 30,
},
PalletMetadata {
@@ -781,7 +832,7 @@ fn test_metadata() {
fn pallet_in_runtime_is_correct() {
assert_eq!(PalletInfo::index::<System>().unwrap(), 30);
assert_eq!(PalletInfo::name::<System>().unwrap(), "System");
assert_eq!(PalletInfo::module_name::<System>().unwrap(), "system");
assert_eq!(PalletInfo::module_name::<System>().unwrap(), "frame_system");
assert!(PalletInfo::crate_version::<System>().is_some());
assert_eq!(PalletInfo::index::<Module1_1>().unwrap(), 31);
@@ -20,12 +20,9 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet, Call, Storage, Config, Event<T>},
System: system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet exclude_parts { Pallet } use_parts { Pallet },
}
}
@@ -1,7 +1,7 @@
error: Unexpected tokens, expected one of `=`, `,`
--> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:29:43
--> tests/construct_runtime_ui/both_use_and_excluded_parts.rs:26:43
|
29 | Pallet: pallet exclude_parts { Pallet } use_parts { Pallet },
26 | Pallet: pallet exclude_parts { Pallet } use_parts { Pallet },
| ^^^^^^^^^
error[E0412]: cannot find type `RuntimeCall` in this scope
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet},
Balance: balances::{Pallet},
@@ -1,11 +1,11 @@
error: Two pallets with the same name!
--> $DIR/conflicting_module_name.rs:10:3
|
10 | Balance: balances::{Pallet},
| ^^^^^^^
--> tests/construct_runtime_ui/conflicting_module_name.rs:7:3
|
7 | Balance: balances::{Pallet},
| ^^^^^^^
error: Two pallets with the same name!
--> $DIR/conflicting_module_name.rs:11:3
|
11 | Balance: balances::{Pallet},
| ^^^^^^^
--> tests/construct_runtime_ui/conflicting_module_name.rs:8:3
|
8 | Balance: balances::{Pallet},
| ^^^^^^^
@@ -0,0 +1,13 @@
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,442 @@
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:3:1
|
3 | / construct_runtime! {
4 | | pub struct Runtime where
5 | | Block = Block,
6 | | NodeBlock = Block,
... |
10 | | }
11 | | }
| |_^
|
= note: `-D deprecated` implied by `-D warnings`
= 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:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
note: required by a bound in `frame_system::Event`
--> $WORKSPACE/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` 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 in `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
note: required because it appears within the type `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `Clone`
--> $RUST/core/src/clone.rs
|
| pub trait Clone: Sized {
| ^^^^^ required by this bound in `Clone`
= note: this error originates in the derive macro `Clone` 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 in `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
note: required because it appears within the type `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `EncodeLike`
--> $CARGO/parity-scale-codec-3.6.1/src/encode_like.rs
|
| pub trait EncodeLike<T: Encode = Self>: Sized + Encode {}
| ^^^^^ required by this bound in `EncodeLike`
= 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 `Runtime: Config` is not satisfied in `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
note: required because it appears within the type `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `Decode`
--> $CARGO/parity-scale-codec-3.6.1/src/codec.rs
|
| pub trait Decode: Sized {
| ^^^^^ required by this bound in `Decode`
= 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 `Runtime: Config` is not satisfied in `frame_system::Event<Runtime>`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
= note: required because it appears within the type `Event<Runtime>`
note: required by a bound in `From`
--> $RUST/core/src/convert/mod.rs
|
| pub trait From<T>: Sized {
| ^ required by this bound in `From`
= 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 `Runtime: Config` is not satisfied in `frame_system::Event<Runtime>`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
= note: required because it appears within the type `Event<Runtime>`
note: required by a bound in `TryInto`
--> $RUST/core/src/convert/mod.rs
|
| pub trait TryInto<T>: Sized {
| ^ required by this bound in `TryInto`
= 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 `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
= 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 `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | 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:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
= help: the trait `TryFrom<OriginCaller>` is implemented for `RawOrigin<<Runtime as Config>::AccountId>`
= 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 `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
= 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` 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:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
= note: required for `Pallet<Runtime>` to implement `Callable<Runtime>`
note: required because it appears within the type `RuntimeCall`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `Clone`
--> $RUST/core/src/clone.rs
|
| pub trait Clone: Sized {
| ^^^^^ required by this bound in `Clone`
= note: this error originates in the derive macro `Clone` 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:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
= note: required for `Pallet<Runtime>` to implement `Callable<Runtime>`
note: required because it appears within the type `RuntimeCall`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `EncodeLike`
--> $CARGO/parity-scale-codec-3.6.1/src/encode_like.rs
|
| pub trait EncodeLike<T: Encode = Self>: Sized + Encode {}
| ^^^^^ required by this bound in `EncodeLike`
= 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 `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
= note: required for `Pallet<Runtime>` to implement `Callable<Runtime>`
note: required because it appears within the type `RuntimeCall`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `Decode`
--> $CARGO/parity-scale-codec-3.6.1/src/codec.rs
|
| pub trait Decode: Sized {
| ^^^^^ required by this bound in `Decode`
= 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 `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:9:3
|
9 | 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::GenesisConfig`
--> $WORKSPACE/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 in `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
note: required because it appears within the type `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `Result`
--> $RUST/core/src/result.rs
|
| pub enum Result<T, E> {
| ^ required by this bound in `Result`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::codec::Decode` 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 in `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
note: required because it appears within the type `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `TryInto`
--> $RUST/core/src/convert/mod.rs
|
| pub trait TryInto<T>: Sized {
| ^^^^^ required by this bound in `TryInto`
= 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 `Runtime: Config` is not satisfied
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
|
= note: required for `Pallet<Runtime>` to implement `Callable<Runtime>`
note: required because it appears within the type `RuntimeCall`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
|
3 | // construct_runtime! {
4 | || pub struct Runtime where
5 | || Block = Block,
6 | || NodeBlock = Block,
... ||
10 | || }
11 | || }
| ||_- in this macro invocation
... |
note: required by a bound in `Result`
--> $RUST/core/src/result.rs
|
| pub enum Result<T, E> {
| ^ required by this bound in `Result`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::codec::Decode` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet},
Balance: balances::{Config, Call, Config<T>, Origin<T>},
@@ -1,5 +1,5 @@
error: `Config` was already declared before. Please remove the duplicate declaration
--> $DIR/double_module_parts.rs:10:37
|
10 | Balance: balances::{Config, Call, Config<T>, Origin<T>},
| ^^^^^^
--> tests/construct_runtime_ui/double_module_parts.rs:7:37
|
7 | Balance: balances::{Config, Call, Config<T>, Origin<T>},
| ^^^^^^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
system: ,
}
@@ -1,5 +1,5 @@
error: expected one of: `crate`, `self`, `super`, identifier
--> $DIR/empty_pallet_path.rs:9:11
--> tests/construct_runtime_ui/empty_pallet_path.rs:6:11
|
9 | system: ,
6 | system: ,
| ^
@@ -25,12 +25,9 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet, Call, Storage, Config, Event<T>},
System: system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet exclude_parts { Call },
}
}
@@ -1,7 +1,7 @@
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:34:34
--> tests/construct_runtime_ui/exclude_undefined_part.rs:31:34
|
34 | Pallet: pallet exclude_parts { Call },
31 | Pallet: pallet exclude_parts { Call },
| ^^^^
error[E0412]: cannot find type `RuntimeCall` in this scope
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
#[cfg(test)]
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
@@ -1,5 +1,5 @@
error: `System` pallet declaration is feature gated, please remove any `#[cfg]` attributes
--> tests/construct_runtime_ui/feature_gated_system_pallet.rs:10:3
|
10 | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
| ^^^^^^
--> tests/construct_runtime_ui/feature_gated_system_pallet.rs:7:3
|
7 | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
| ^^^^^^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet},
Balance: balances::<Instance1>::{Call<T>, Origin<T>},
@@ -1,5 +1,5 @@
error: `Call` is not allowed to have generics. Only the following pallets are allowed to have generics: `Event`, `Error`, `Origin`, `Config`.
--> $DIR/generics_in_invalid_module.rs:10:36
|
10 | Balance: balances::<Instance1>::{Call<T>, Origin<T>},
| ^^^^
--> tests/construct_runtime_ui/generics_in_invalid_module.rs:7:36
|
7 | Balance: balances::<Instance1>::{Call<T>, Origin<T>},
| ^^^^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet},
#[cfg(feature = 1)]
@@ -1,6 +1,6 @@
error: feature = 1
^ expected one of `<key>`, `all`, `any`, `not` here
--> tests/construct_runtime_ui/invalid_meta_literal.rs:10:3
|
10 | #[cfg(feature = 1)]
| ^
--> tests/construct_runtime_ui/invalid_meta_literal.rs:7:3
|
7 | #[cfg(feature = 1)]
| ^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
system: System::(),
}
@@ -1,5 +1,5 @@
error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,`
--> tests/construct_runtime_ui/invalid_module_details.rs:9:17
--> tests/construct_runtime_ui/invalid_module_details.rs:6:17
|
9 | system: System::(),
6 | system: System::(),
| ^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
system: System::{enum},
}
@@ -1,5 +1,5 @@
error: expected one of: `Pallet`, `Call`, `Storage`, `Event`, `Error`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned`, `FreezeReason`, `HoldReason`, `LockId`, `SlashReason`
--> $DIR/invalid_module_details_keyword.rs:9:20
--> tests/construct_runtime_ui/invalid_module_details_keyword.rs:6:20
|
9 | system: System::{enum},
6 | system: System::{enum},
| ^^^^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet},
Balance: balances::{Unexpected},
@@ -1,5 +1,5 @@
error: expected one of: `Pallet`, `Call`, `Storage`, `Event`, `Error`, `Config`, `Origin`, `Inherent`, `ValidateUnsigned`, `FreezeReason`, `HoldReason`, `LockId`, `SlashReason`
--> $DIR/invalid_module_entry.rs:10:23
|
10 | Balance: balances::{Unexpected},
| ^^^^^^^^^^
--> tests/construct_runtime_ui/invalid_module_entry.rs:7:23
|
7 | Balance: balances::{Unexpected},
| ^^^^^^^^^^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
system: System ?
}
@@ -1,5 +1,5 @@
error: Unexpected tokens, expected one of `::$ident` `::{`, `exclude_parts`, `use_parts`, `=`, `,`
--> $DIR/invalid_token_after_module.rs:9:18
--> tests/construct_runtime_ui/invalid_token_after_module.rs:6:18
|
9 | system: System ?
6 | system: System ?
| ^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
system ?
}
@@ -1,5 +1,5 @@
error: expected `:`
--> $DIR/invalid_token_after_name.rs:9:10
--> tests/construct_runtime_ui/invalid_token_after_name.rs:6:10
|
9 | system ?
6 | system ?
| ^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system expanded::{}::{Pallet},
Balance: balances::<Instance1> expanded::{}::{Event},
@@ -1,5 +1,5 @@
error: Instantiable pallet with no generic `Event` cannot be constructed: pallet `Balance` must have generic `Event`
--> $DIR/missing_event_generic_on_module_with_instance.rs:10:3
|
10 | Balance: balances::<Instance1> expanded::{}::{Event},
| ^^^^^^^
--> tests/construct_runtime_ui/missing_event_generic_on_module_with_instance.rs:7:3
|
7 | Balance: balances::<Instance1> expanded::{}::{Event},
| ^^^^^^^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
system: System::<>,
}
@@ -1,5 +1,5 @@
error: expected identifier
--> $DIR/missing_module_instance.rs:9:20
--> tests/construct_runtime_ui/missing_module_instance.rs:6:20
|
9 | system: System::<>,
6 | system: System::<>,
| ^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system expanded::{}::{Pallet},
Balance: balances::<Instance1> expanded::{}::{Origin},
@@ -1,5 +1,5 @@
error: Instantiable pallet with no generic `Origin` cannot be constructed: pallet `Balance` must have generic `Origin`
--> $DIR/missing_origin_generic_on_module_with_instance.rs:10:3
|
10 | Balance: balances::<Instance1> expanded::{}::{Origin},
| ^^^^^^^
--> tests/construct_runtime_ui/missing_origin_generic_on_module_with_instance.rs:7:3
|
7 | Balance: balances::<Instance1> expanded::{}::{Origin},
| ^^^^^^^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
}
}
@@ -1,6 +1,6 @@
error: `System` pallet declaration is missing. Please add this line: `System: frame_system::{Pallet, Call, Storage, Config, Event<T>},`
--> $DIR/missing_system_module.rs:8:2
error: `System` pallet declaration is missing. Please add this line: `System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},`
--> tests/construct_runtime_ui/missing_system_module.rs:5:2
|
8 | / {
9 | | }
5 | / {
6 | | }
| |_____^
@@ -1,7 +0,0 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime {}
}
fn main() {}
@@ -1,5 +0,0 @@
error: expected `where`
--> tests/construct_runtime_ui/missing_where_block.rs:4:21
|
4 | pub struct Runtime {}
| ^
@@ -23,13 +23,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
@@ -47,10 +46,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet1: pallet::{Pallet},
@@ -1,7 +1,7 @@
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:50:2
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:49:2
|
50 | pub struct Runtime where
49 | pub struct Runtime
| ^^^
error[E0412]: cannot find type `RuntimeCall` in this scope
@@ -34,26 +34,26 @@ error[E0412]: cannot find type `RuntimeOrigin` in this scope
| ^^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeOrigin`
error[E0412]: cannot find type `RuntimeCall` in this scope
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:27:21
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:26:21
|
27 | type RuntimeCall = RuntimeCall;
26 | type RuntimeCall = RuntimeCall;
| ^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeCall`
error[E0412]: cannot find type `RuntimeEvent` in this scope
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:33:22
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:32:22
|
33 | type RuntimeEvent = RuntimeEvent;
32 | type RuntimeEvent = RuntimeEvent;
| ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent`
error[E0412]: cannot find type `PalletInfo` in this scope
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:39:20
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:38:20
|
39 | type PalletInfo = PalletInfo;
38 | type PalletInfo = PalletInfo;
| ^^^^^^^^^^
|
help: you might have meant to use the associated type
|
39 | type PalletInfo = Self::PalletInfo;
38 | type PalletInfo = Self::PalletInfo;
| ~~~~~~~~~~~~~~~~
help: consider importing this trait
|
@@ -48,13 +48,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
@@ -72,10 +71,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet::{Pallet},
@@ -1,13 +1,13 @@
error[E0080]: evaluation of constant value failed
--> tests/construct_runtime_ui/pallet_error_too_large.rs:74:1
--> tests/construct_runtime_ui/pallet_error_too_large.rs:73:1
|
74 | / construct_runtime! {
75 | | pub struct Runtime where
76 | | Block = Block,
77 | | NodeBlock = Block,
... |
82 | | }
83 | | }
| |_^ the evaluated program panicked at 'The maximum encoded size of the error type in the `Pallet` pallet exceeds `MAX_MODULE_ERROR_ENCODED_SIZE`', $DIR/tests/construct_runtime_ui/pallet_error_too_large.rs:74:1
73 | / construct_runtime! {
74 | | pub struct Runtime
75 | | {
76 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
77 | | Pallet: pallet::{Pallet},
78 | | }
79 | | }
| |_^ the evaluated program panicked at 'The maximum encoded size of the error type in the `Pallet` pallet exceeds `MAX_MODULE_ERROR_ENCODED_SIZE`', $DIR/tests/construct_runtime_ui/pallet_error_too_large.rs:73:1
|
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -23,13 +23,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
@@ -47,10 +46,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet::{Pallet, Call},
@@ -4,13 +4,13 @@ error: `Pallet` does not have #[pallet::call] defined, perhaps you should remove
5 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
48 | / construct_runtime! {
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet::{Pallet, Call},
53 | | }
54 | | }
| |_- 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 `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -23,13 +23,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
@@ -47,10 +46,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Event},
@@ -4,27 +4,27 @@ error: `Pallet` does not have #[pallet::event] defined, perhaps you should remov
5 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
48 | / construct_runtime! {
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Event},
53 | | }
54 | | }
| |_- 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:49:1
--> tests/construct_runtime_ui/undefined_event_part.rs:48:1
|
49 | / construct_runtime! {
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
48 | / construct_runtime! {
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Event},
53 | | }
54 | | }
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -23,13 +23,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
@@ -47,10 +46,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Config},
@@ -4,27 +4,27 @@ error: `Pallet` does not have #[pallet::genesis_config] defined, perhaps you sho
5 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
48 | / construct_runtime! {
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Config},
53 | | }
54 | | }
| |_- 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:49:1
--> tests/construct_runtime_ui/undefined_genesis_config_part.rs:48:1
|
49 | / construct_runtime! {
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
48 | / construct_runtime! {
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Config},
53 | | }
54 | | }
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -23,13 +23,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
@@ -47,10 +46,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Inherent},
@@ -4,31 +4,31 @@ error: `Pallet` does not have #[pallet::inherent] defined, perhaps you should re
5 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
48 | / construct_runtime! {
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
53 | | }
54 | | }
| |_- 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:49:1
--> tests/construct_runtime_ui/undefined_inherent_part.rs:48:1
|
11 | pub struct Pallet<T>(_);
| -------------------- function or associated item `create_inherent` not found for this struct
...
49 | construct_runtime! {
48 | construct_runtime! {
| _^
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
53 | | }
54 | | }
| |_^ 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
@@ -37,19 +37,19 @@ error[E0599]: no function or associated item named `create_inherent` found for s
= 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:49:1
--> tests/construct_runtime_ui/undefined_inherent_part.rs:48:1
|
11 | pub struct Pallet<T>(_);
| -------------------- function or associated item `is_inherent` not found for this struct
...
49 | construct_runtime! {
48 | construct_runtime! {
| _^
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
53 | | }
54 | | }
| |_^ 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
@@ -58,19 +58,19 @@ error[E0599]: no function or associated item named `is_inherent` found for struc
= 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:49:1
--> tests/construct_runtime_ui/undefined_inherent_part.rs:48:1
|
11 | pub struct Pallet<T>(_);
| -------------------- function or associated item `check_inherent` not found for this struct
...
49 | construct_runtime! {
48 | construct_runtime! {
| _^
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
53 | | }
54 | | }
| |_^ 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
@@ -79,19 +79,19 @@ error[E0599]: no function or associated item named `check_inherent` found for st
= 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:49:1
--> tests/construct_runtime_ui/undefined_inherent_part.rs:48:1
|
11 | pub struct Pallet<T>(_);
| -------------------- associated item `INHERENT_IDENTIFIER` not found for this struct
...
49 | construct_runtime! {
48 | construct_runtime! {
| _^
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
53 | | }
54 | | }
| |_^ associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
@@ -100,19 +100,19 @@ error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `p
= 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:49:1
--> tests/construct_runtime_ui/undefined_inherent_part.rs:48:1
|
11 | pub struct Pallet<T>(_);
| -------------------- function or associated item `is_inherent_required` not found for this struct
...
49 | construct_runtime! {
48 | construct_runtime! {
| _^
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
53 | | }
54 | | }
| |_^ 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
@@ -23,13 +23,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
@@ -47,10 +46,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet expanded::{}::{Pallet, Origin},
@@ -4,27 +4,27 @@ error: `Pallet` does not have #[pallet::origin] defined, perhaps you should remo
5 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
48 | / construct_runtime! {
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Origin},
53 | | }
54 | | }
| |_- 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:49:1
--> tests/construct_runtime_ui/undefined_origin_part.rs:48:1
|
49 | / construct_runtime! {
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
48 | / construct_runtime! {
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet expanded::{}::{Pallet, Origin},
53 | | }
54 | | }
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -23,13 +23,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
@@ -47,10 +46,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet::{Pallet, ValidateUnsigned},
@@ -4,48 +4,46 @@ error: `Pallet` does not have #[pallet::validate_unsigned] defined, perhaps you
5 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
49 | / construct_runtime! {
50 | | pub struct Runtime where
51 | | Block = Block,
52 | | NodeBlock = Block,
... |
57 | | }
58 | | }
48 | / construct_runtime! {
49 | | pub struct Runtime
50 | | {
51 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | | Pallet: pallet::{Pallet, ValidateUnsigned},
53 | | }
54 | | }
| |_- 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 `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:56:3
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:52:3
|
49 | // construct_runtime! {
50 | || pub struct Runtime where
51 | || Block = Block,
52 | || NodeBlock = Block,
... ||
55 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
56 | || Pallet: pallet::{Pallet, ValidateUnsigned},
48 | // construct_runtime! {
49 | || pub struct Runtime
50 | || {
51 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | || Pallet: pallet::{Pallet, ValidateUnsigned},
| || -^^^^^^ variant or associated item not found in `RuntimeCall`
| ||________|
| |
... |
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:49:1
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:48:1
|
11 | pub struct Pallet<T>(_);
| -------------------- function or associated item `pre_dispatch` not found for this struct
...
49 | construct_runtime! {
48 | construct_runtime! {
| __^
| | _|
| ||
50 | || pub struct Runtime where
51 | || Block = Block,
52 | || NodeBlock = Block,
... ||
57 | || }
58 | || }
49 | || pub struct Runtime
50 | || {
51 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | || Pallet: pallet::{Pallet, ValidateUnsigned},
53 | || }
54 | || }
| ||_- in this macro invocation
... |
|
@@ -56,21 +54,21 @@ error[E0599]: no function or associated item named `pre_dispatch` found for stru
= 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[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:49:1
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:48:1
|
11 | pub struct Pallet<T>(_);
| -------------------- function or associated item `validate_unsigned` not found for this struct
...
49 | construct_runtime! {
48 | construct_runtime! {
| __^
| | _|
| ||
50 | || pub struct Runtime where
51 | || Block = Block,
52 | || NodeBlock = Block,
... ||
57 | || }
58 | || }
49 | || pub struct Runtime
50 | || {
51 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
52 | || Pallet: pallet::{Pallet, ValidateUnsigned},
53 | || }
54 | || }
| ||_- in this macro invocation
... |
|
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet},
#[cfg(feature(test))]
@@ -1,6 +1,6 @@
error: feature(test)
^ expected one of `=`, `,`, `)` here
--> tests/construct_runtime_ui/unsupported_meta_structure.rs:10:3
|
10 | #[cfg(feature(test))]
| ^
--> tests/construct_runtime_ui/unsupported_meta_structure.rs:7:3
|
7 | #[cfg(feature(test))]
| ^
@@ -1,10 +1,7 @@
use frame_support::construct_runtime;
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet},
#[attr]
@@ -1,5 +1,5 @@
error: Unsupported attribute, only #[cfg] is supported on pallet declarations in `construct_runtime`
--> tests/construct_runtime_ui/unsupported_pallet_attr.rs:10:3
|
10 | #[attr]
| ^
--> tests/construct_runtime_ui/unsupported_pallet_attr.rs:7:3
|
7 | #[attr]
| ^
@@ -25,12 +25,9 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: system::{Pallet, Call, Storage, Config, Event<T>},
System: system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: pallet use_parts { Call },
}
}
@@ -1,7 +1,7 @@
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:34:30
--> tests/construct_runtime_ui/use_undefined_part.rs:31:30
|
34 | Pallet: pallet use_parts { Call },
31 | Pallet: pallet use_parts { Call },
| ^^^^
error[E0412]: cannot find type `RuntimeCall` in this scope
@@ -16,8 +16,10 @@
// limitations under the License.
use codec::Encode;
use frame_support::{storage::unhashed, StoragePrefixedMap};
use sp_core::sr25519;
use frame_support::{derive_impl, storage::unhashed, StoragePrefixedMap};
use frame_system::pallet_prelude::BlockNumberFor;
use sp_core::{sr25519, ConstU32};
use sp_io::{
hashing::{blake2_128, twox_128, twox_64},
TestExternalities,
@@ -31,7 +33,6 @@ use sp_runtime::{
mod no_instance {
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
#[pallet::pallet]
pub struct Pallet<T>(_);
@@ -59,7 +60,7 @@ mod no_instance {
#[pallet::storage]
#[pallet::getter(fn test_generic_value)]
pub type TestGenericValue<T: Config> = StorageValue<_, T::BlockNumber, OptionQuery>;
pub type TestGenericValue<T: Config> = StorageValue<_, BlockNumberFor<T>, OptionQuery>;
#[pallet::storage]
#[pallet::getter(fn foo2)]
pub type TestGenericDoubleMap<T: Config> = StorageDoubleMap<
@@ -67,7 +68,7 @@ mod no_instance {
Blake2_128Concat,
u32,
Blake2_128Concat,
T::BlockNumber,
BlockNumberFor<T>,
u32,
ValueQuery,
>;
@@ -75,8 +76,8 @@ mod no_instance {
#[pallet::genesis_config]
pub struct GenesisConfig<T: Config> {
pub value: u32,
pub test_generic_value: T::BlockNumber,
pub test_generic_double_map: Vec<(u32, T::BlockNumber, u32)>,
pub test_generic_value: BlockNumberFor<T>,
pub test_generic_double_map: Vec<(u32, BlockNumberFor<T>, u32)>,
}
impl<T: Config> Default for GenesisConfig<T> {
@@ -105,7 +106,6 @@ mod no_instance {
mod instance {
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
@@ -136,7 +136,7 @@ mod instance {
#[pallet::storage]
#[pallet::getter(fn test_generic_value)]
pub type TestGenericValue<T: Config<I>, I: 'static = ()> =
StorageValue<_, T::BlockNumber, OptionQuery>;
StorageValue<_, BlockNumberFor<T>, OptionQuery>;
#[pallet::storage]
#[pallet::getter(fn foo2)]
pub type TestGenericDoubleMap<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
@@ -144,7 +144,7 @@ mod instance {
Blake2_128Concat,
u32,
Blake2_128Concat,
T::BlockNumber,
BlockNumberFor<T>,
u32,
ValueQuery,
>;
@@ -152,8 +152,8 @@ mod instance {
#[pallet::genesis_config]
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
pub value: u32,
pub test_generic_value: T::BlockNumber,
pub test_generic_double_map: Vec<(u32, T::BlockNumber, u32)>,
pub test_generic_value: BlockNumberFor<T>,
pub test_generic_double_map: Vec<(u32, BlockNumberFor<T>, u32)>,
pub phantom: PhantomData<I>,
}
@@ -201,27 +201,25 @@ pub type Block = generic::Block<Header, UncheckedExtrinsic>;
frame_support::construct_runtime!(
pub enum Runtime
where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_support_test,
System: frame_system,
FinalKeysNone: no_instance,
FinalKeysSome: instance,
Instance2FinalKeysSome: instance::<Instance2>,
}
);
impl frame_support_test::Config for Runtime {
type BlockNumber = BlockNumber;
type AccountId = AccountId;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type Block = Block;
type BlockHashCount = ConstU32<10>;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type PalletInfo = PalletInfo;
type DbWeight = ();
type OnSetCode = ();
}
impl no_instance::Config for Runtime {}
@@ -15,7 +15,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use sp_core::sr25519;
use frame_support::derive_impl;
use frame_system::pallet_prelude::BlockNumberFor;
use sp_core::{sr25519, ConstU32};
use sp_runtime::{
generic,
traits::{BlakeTwo256, Verify},
@@ -25,7 +27,6 @@ use sp_runtime::{
pub mod pallet {
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
#[pallet::pallet]
pub struct Pallet<T>(_);
@@ -39,11 +40,11 @@ pub mod pallet {
#[pallet::storage]
#[pallet::unbounded]
pub type AppendableDM<T: Config> =
StorageDoubleMap<_, Identity, u32, Identity, T::BlockNumber, Vec<u32>>;
StorageDoubleMap<_, Identity, u32, Identity, BlockNumberFor<T>, Vec<u32>>;
#[pallet::genesis_config]
pub struct GenesisConfig<T: Config> {
pub t: Vec<(u32, T::BlockNumber, Vec<u32>)>,
pub t: Vec<(u32, BlockNumberFor<T>, Vec<u32>)>,
}
impl<T: Config> Default for GenesisConfig<T> {
@@ -71,25 +72,23 @@ pub type Block = generic::Block<Header, UncheckedExtrinsic>;
frame_support::construct_runtime!(
pub enum Test
where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_support_test,
System: frame_system,
MyPallet: pallet,
}
);
impl frame_support_test::Config for Test {
type BlockNumber = BlockNumber;
type AccountId = AccountId;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type Block = Block;
type BlockHashCount = ConstU32<10>;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type PalletInfo = PalletInfo;
type DbWeight = ();
type OnSetCode = ();
}
impl pallet::Config for Test {}
+14 -17
View File
@@ -18,6 +18,7 @@
#![recursion_limit = "128"]
use frame_support::{
derive_impl,
inherent::{InherentData, InherentIdentifier, MakeFatalError, ProvideInherent},
metadata_ir::{
PalletStorageMetadataIR, StorageEntryMetadataIR, StorageEntryModifierIR,
@@ -25,6 +26,7 @@ use frame_support::{
},
traits::ConstU32,
};
use frame_system::pallet_prelude::BlockNumberFor;
use sp_core::sr25519;
use sp_runtime::{
generic,
@@ -39,10 +41,9 @@ pub trait Currency {}
// * Origin, Inherent, Event
#[frame_support::pallet(dev_mode)]
mod module1 {
use self::frame_system::pallet_prelude::*;
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
use frame_system::pallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T, I = ()>(_);
@@ -77,7 +78,7 @@ mod module1 {
#[pallet::genesis_config]
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
pub value: <T as Config<I>>::GenericType,
pub test: <T as frame_system::Config>::BlockNumber,
pub test: BlockNumberFor<T>,
}
impl<T: Config<I>, I: 'static> Default for GenesisConfig<T, I> {
@@ -89,7 +90,7 @@ mod module1 {
#[pallet::genesis_build]
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I>
where
T::BlockNumber: std::fmt::Display,
BlockNumberFor<T>: std::fmt::Display,
{
fn build(&self) {
<Value<T, I>>::put(self.value.clone());
@@ -123,7 +124,7 @@ mod module1 {
#[pallet::inherent]
impl<T: Config<I>, I: 'static> ProvideInherent for Pallet<T, I>
where
T::BlockNumber: From<u32>,
BlockNumberFor<T>: From<u32>,
{
type Call = Call<T, I>;
type Error = MakeFatalError<()>;
@@ -150,7 +151,6 @@ mod module1 {
mod module2 {
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
@@ -198,7 +198,7 @@ mod module2 {
#[pallet::genesis_build]
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I>
where
T::BlockNumber: std::fmt::Display,
BlockNumberFor<T>: std::fmt::Display,
{
fn build(&self) {
<Value<T, I>>::put(self.value.clone());
@@ -252,7 +252,6 @@ mod module2 {
mod module3 {
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
#[pallet::pallet]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
@@ -277,12 +276,9 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
frame_support::construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub enum Runtime
{
System: frame_support_test::{Pallet, Call, Event<T>},
System: frame_system::{Pallet, Call, Event<T>},
Module1_1: module1::<Instance1>::{
Pallet, Call, Storage, Event<T>, Config<T>, Origin<T>, Inherent
},
@@ -303,15 +299,16 @@ frame_support::construct_runtime!(
}
);
impl frame_support_test::Config for Runtime {
type BlockNumber = BlockNumber;
type AccountId = AccountId;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type Block = Block;
type BlockHashCount = ConstU32<10>;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type PalletInfo = PalletInfo;
type DbWeight = ();
type OnSetCode = ();
}
impl module1::Config<module1::Instance1> for Runtime {
+22 -25
View File
@@ -15,6 +15,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::derive_impl;
use frame_system::pallet_prelude::BlockNumberFor;
use sp_core::{sr25519, ConstU64};
use sp_runtime::{
generic,
@@ -25,10 +27,8 @@ use sp_runtime::{
mod module {
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
pub type Request<T> =
(<T as frame_system::Config>::AccountId, Role, <T as frame_system::Config>::BlockNumber);
pub type Request<T> = (<T as frame_system::Config>::AccountId, Role, BlockNumberFor<T>);
pub type Requests<T> = Vec<Request<T>>;
#[derive(Copy, Clone, Eq, PartialEq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)]
@@ -46,35 +46,35 @@ mod module {
pub max_actors: u32,
// payouts are made at this block interval
pub reward_period: T::BlockNumber,
pub reward_period: BlockNumberFor<T>,
// minimum amount of time before being able to unstake
pub bonding_period: T::BlockNumber,
pub bonding_period: BlockNumberFor<T>,
// how long tokens remain locked for after unstaking
pub unbonding_period: T::BlockNumber,
pub unbonding_period: BlockNumberFor<T>,
// minimum period required to be in service. unbonding before this time is highly penalized
pub min_service_period: T::BlockNumber,
pub min_service_period: BlockNumberFor<T>,
// "startup" time allowed for roles that need to sync their infrastructure
// with other providers before they are considered in service and punishable for
// not delivering required level of service.
pub startup_grace_period: T::BlockNumber,
pub startup_grace_period: BlockNumberFor<T>,
}
impl<T: Config> Default for RoleParameters<T> {
fn default() -> Self {
Self {
max_actors: 10,
reward_period: T::BlockNumber::default(),
unbonding_period: T::BlockNumber::default(),
reward_period: BlockNumberFor::<T>::default(),
unbonding_period: BlockNumberFor::<T>::default(),
// not currently used
min_actors: 5,
bonding_period: T::BlockNumber::default(),
min_service_period: T::BlockNumber::default(),
startup_grace_period: T::BlockNumber::default(),
bonding_period: BlockNumberFor::<T>::default(),
min_service_period: BlockNumberFor::<T>::default(),
startup_grace_period: BlockNumberFor::<T>::default(),
}
}
}
@@ -115,7 +115,7 @@ mod module {
/// tokens locked until given block number
#[pallet::storage]
#[pallet::getter(fn bondage)]
pub type Bondage<T: Config> = StorageMap<_, Blake2_128Concat, T::AccountId, T::BlockNumber>;
pub type Bondage<T: Config> = StorageMap<_, Blake2_128Concat, T::AccountId, BlockNumberFor<T>>;
/// First step before enter a role is registering intent with a new account/key.
/// This is done by sending a role_entry_request() from the new account.
@@ -161,27 +161,23 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
impl frame_support_test::Config for Runtime {
type BlockNumber = BlockNumber;
type AccountId = AccountId;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type Block = Block;
type BlockHashCount = ConstU64<10>;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type PalletInfo = PalletInfo;
type DbWeight = ();
type OnSetCode = ();
}
impl module::Config for Runtime {}
frame_support::construct_runtime!(
pub struct Runtime
where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_support_test,
pub struct Runtime {
System: frame_system,
Module: module,
}
);
@@ -189,6 +185,7 @@ frame_support::construct_runtime!(
#[test]
fn create_genesis_config() {
let config = RuntimeGenesisConfig {
system: Default::default(),
module: module::GenesisConfig {
request_life_time: 0,
enable_storage_role: true,
+14 -14
View File
@@ -19,15 +19,18 @@
#![recursion_limit = "128"]
use frame_support::traits::{Contains, OriginTrait};
use frame_support::{
derive_impl,
traits::{Contains, OriginTrait},
};
use sp_core::ConstU32;
use sp_runtime::{generic, traits::BlakeTwo256};
mod nested {
#[frame_support::pallet(dev_mode)]
pub mod module {
use self::frame_system::pallet_prelude::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
use frame_system::pallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
@@ -75,9 +78,8 @@ mod nested {
#[frame_support::pallet(dev_mode)]
pub mod module {
use self::frame_system::pallet_prelude::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
use frame_system::pallet_prelude::*;
#[pallet::pallet]
pub struct Pallet<T>(_);
@@ -160,26 +162,24 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, (),
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
frame_support::construct_runtime!(
pub enum RuntimeOriginTest where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub enum RuntimeOriginTest
{
System: frame_support_test,
System: frame_system,
NestedModule: nested::module,
Module: module,
}
);
impl frame_support_test::Config for RuntimeOriginTest {
type BlockNumber = BlockNumber;
type AccountId = AccountId;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for RuntimeOriginTest {
type BaseCallFilter = BaseCallFilter;
type Block = Block;
type BlockHashCount = ConstU32<10>;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type PalletInfo = PalletInfo;
type DbWeight = ();
type OnSetCode = ();
}
impl nested::module::Config for RuntimeOriginTest {
+2 -6
View File
@@ -657,13 +657,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ConstU32<250>;
type BlockWeights = ();
@@ -709,10 +708,7 @@ pub type UncheckedExtrinsic =
sp_runtime::testing::TestXt<RuntimeCall, frame_system::CheckNonZeroSender<Runtime>>;
frame_support::construct_runtime!(
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
// Exclude part `Storage` in order not to check its metadata in tests.
System: frame_system exclude_parts { Pallet, Storage },
@@ -292,13 +292,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ConstU32<250>;
type BlockWeights = ();
@@ -336,10 +335,7 @@ pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, RuntimeCall, (), ()>;
frame_support::construct_runtime!(
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
// Exclude part `Storage` in order not to check its metadata in tests.
System: frame_system exclude_parts { Storage },
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::traits::ConstU32;
use frame_support::{derive_impl, traits::ConstU32};
mod common;
@@ -25,31 +25,16 @@ pub type Header = sp_runtime::generic::Header<u32, sp_runtime::traits::BlakeTwo2
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, RuntimeCall, (), ()>;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type Block = Block;
type BlockHashCount = ConstU32<10>;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = 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 = ConstU32<16>;
}
impl common::outer_enums::pallet::Config for Runtime {
@@ -72,10 +57,7 @@ impl common::outer_enums::pallet3::Config<common::outer_enums::pallet::Instance1
}
frame_support::construct_runtime!(
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
// Exclude part `Storage` in order not to check its metadata in tests.
System: frame_system::{Pallet, Config<T>, Call, Event<T> },
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::traits::ConstU32;
use frame_support::{derive_impl, traits::ConstU32};
mod common;
@@ -25,31 +25,16 @@ pub type Header = sp_runtime::generic::Header<u32, sp_runtime::traits::BlakeTwo2
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, RuntimeCall, (), ()>;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type Block = Block;
type BlockHashCount = ConstU32<10>;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = 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 = ConstU32<16>;
}
impl common::outer_enums::pallet::Config for Runtime {
@@ -72,10 +57,7 @@ impl common::outer_enums::pallet3::Config<common::outer_enums::pallet::Instance1
}
frame_support::construct_runtime!(
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
// Exclude part `Storage` in order not to check its metadata in tests.
System: frame_system exclude_parts { Storage },
@@ -61,13 +61,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ConstU32<250>;
type BlockWeights = ();
@@ -89,10 +88,7 @@ pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, RuntimeCall, (), ()>;
frame_support::construct_runtime!(
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
// Exclude part `Storage` in order not to check its metadata in tests.
System: frame_system exclude_parts { Pallet, Storage },
@@ -14,13 +14,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = frame_support::traits::ConstU32<250>;
type BlockWeights = ();
@@ -38,10 +37,7 @@ impl frame_system::Config for Runtime {
}
construct_runtime! {
pub struct Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub struct Runtime
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
Pallet: test_pallet::{Pallet, Config<T>},
@@ -37,13 +37,12 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u32;
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 Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ConstU32<250>;
type Version = ();
@@ -58,10 +57,7 @@ impl frame_system::Config for Runtime {
}
frame_support::construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
pub enum Runtime
{
System: frame_system,
}
@@ -71,12 +71,11 @@ impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type Index = Index;
type BlockNumber = BlockNumber;
type Hash = sp_runtime::testing::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = AccountId;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Header = Header;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ConstU32<250>;
type DbWeight = ();
@@ -94,12 +93,7 @@ impl frame_system::Config for Runtime {
impl Config for Runtime {}
frame_support::construct_runtime!(
pub struct Runtime
where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
pub struct Runtime {
System: frame_system,
MyPallet: pallet,
}
@@ -19,12 +19,12 @@
#![allow(deprecated)]
use frame_support::{
assert_noop, assert_ok, assert_storage_noop,
assert_noop, assert_ok, assert_storage_noop, derive_impl,
dispatch::DispatchResult,
storage::{with_transaction, TransactionOutcome::*},
transactional,
};
use sp_core::sr25519;
use sp_core::{sr25519, ConstU32};
use sp_io::TestExternalities;
use sp_runtime::{
generic,
@@ -36,10 +36,9 @@ pub use self::pallet::*;
#[frame_support::pallet]
pub mod pallet {
use self::frame_system::pallet_prelude::*;
use super::*;
use frame_support::pallet_prelude::*;
use frame_support_test as frame_system;
use frame_system::pallet_prelude::*;
#[pallet::pallet]
#[pallet::generate_store(pub (super) trait Store)]
@@ -82,25 +81,23 @@ pub type Block = generic::Block<Header, UncheckedExtrinsic>;
frame_support::construct_runtime!(
pub enum Runtime
where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_support_test,
System: frame_system,
MyPallet: pallet,
}
);
impl frame_support_test::Config for Runtime {
type BlockNumber = BlockNumber;
type AccountId = AccountId;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type Block = Block;
type BlockHashCount = ConstU32<10>;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type PalletInfo = PalletInfo;
type DbWeight = ();
type OnSetCode = ();
}
impl Config for Runtime {}
@@ -27,9 +27,9 @@ use frame_support::{
weights::constants::RocksDbWeight,
};
use frame_system::Config;
use sp_core::ConstU64;
use sp_runtime::BuildStorage;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
#[frame_support::pallet]
@@ -64,10 +64,7 @@ mod dummy_pallet {
impl dummy_pallet::Config for Test {}
construct_runtime!(
pub enum Test where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
pub enum Test
{
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>} = 0,
DummyPallet: dummy_pallet::{Pallet, Config<T>, Storage} = 1,
@@ -77,6 +74,8 @@ construct_runtime!(
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type Block = Block;
type BlockHashCount = ConstU64<10>;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;