mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 21:41:02 +00:00
Moves all test runtimes to use derive_impl (#2409)
Step in https://github.com/paritytech/polkadot-sdk/issues/171 This PR adds `derive_impl` on all `frame_system` config impls for mock runtimes. The overridden configs are maintained as of now to ensure minimal changes. --------- Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -45,6 +45,8 @@ parameter_types! {
|
||||
pub BlockWeights: frame_system::limits::BlockWeights =
|
||||
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, u64::MAX));
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
|
||||
impl frame_system::Config for Test {
|
||||
type BaseCallFilter = Everything;
|
||||
type BlockWeights = ();
|
||||
|
||||
@@ -51,6 +51,7 @@ parameter_types! {
|
||||
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, u64::MAX));
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
|
||||
impl frame_system::Config for Test {
|
||||
type BaseCallFilter = Everything;
|
||||
type BlockWeights = ();
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
use codec::Encode;
|
||||
use frame_support::{
|
||||
construct_runtime, match_types, parameter_types,
|
||||
construct_runtime, derive_impl, match_types, parameter_types,
|
||||
traits::{
|
||||
AsEnsureOriginWithArg, ConstU128, ConstU32, Contains, Equals, Everything, EverythingBut,
|
||||
Nothing,
|
||||
@@ -246,6 +246,7 @@ parameter_types! {
|
||||
pub const BlockHashCount: u64 = 250;
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
|
||||
impl frame_system::Config for Test {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
fn ui() {
|
||||
// Only run the ui tests when `RUN_UI_TESTS` is set.
|
||||
if std::env::var("RUN_UI_TESTS").is_err() {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
// As trybuild is using `cargo check`, we don't need the real WASM binaries.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{ConstU32, Everything, Nothing},
|
||||
weights::Weight,
|
||||
};
|
||||
@@ -76,6 +76,7 @@ parameter_types! {
|
||||
pub const BlockHashCount: u64 = 250;
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
|
||||
impl frame_system::Config for Runtime {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use codec::{Decode, Encode};
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{ContainsPair, EnsureOrigin, EnsureOriginWithArg, Everything, EverythingBut, Nothing},
|
||||
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
|
||||
};
|
||||
@@ -63,6 +63,7 @@ parameter_types! {
|
||||
pub const BlockHashCount: u64 = 250;
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
|
||||
impl frame_system::Config for Runtime {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Relay chain runtime mock.
|
||||
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{AsEnsureOriginWithArg, Everything, Nothing, ProcessMessage, ProcessMessageError},
|
||||
weights::{Weight, WeightMeter},
|
||||
};
|
||||
@@ -49,6 +49,7 @@ parameter_types! {
|
||||
pub const BlockHashCount: u64 = 250;
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
|
||||
impl frame_system::Config for Runtime {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{Everything, Nothing},
|
||||
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
|
||||
};
|
||||
@@ -52,6 +52,7 @@ parameter_types! {
|
||||
pub const BlockHashCount: u64 = 250;
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
|
||||
impl frame_system::Config for Runtime {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Relay chain runtime mock.
|
||||
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{Everything, Nothing, ProcessMessage, ProcessMessageError},
|
||||
weights::{Weight, WeightMeter},
|
||||
};
|
||||
@@ -48,6 +48,7 @@ parameter_types! {
|
||||
pub const BlockHashCount: u64 = 250;
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
|
||||
impl frame_system::Config for Runtime {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
|
||||
Reference in New Issue
Block a user