diff --git a/pallets/chainbridge/src/mock.rs b/pallets/chainbridge/src/mock.rs index 63e3ed302..89c79fa59 100644 --- a/pallets/chainbridge/src/mock.rs +++ b/pallets/chainbridge/src/mock.rs @@ -1,5 +1,5 @@ use frame_support::{ - assert_ok, ord_parameter_types, parameter_types, traits::Everything, weights::Weight, + assert_ok, ord_parameter_types, parameter_types,derive_impl, traits::Everything, weights::Weight, }; use frame_system::{self as system}; pub use pallet_balances as balances; @@ -19,10 +19,9 @@ parameter_types! { pub const MaxLocks: u32 = 50; } +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; type RuntimeTask = RuntimeTask; @@ -34,17 +33,10 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); // type ModuleToIndex = (); type PalletInfo = PalletInfo; // type MaxLocks = MaxLocks; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; } diff --git a/pallets/ddc-clusters-gov/src/mock.rs b/pallets/ddc-clusters-gov/src/mock.rs index d858dd9a6..9d038be57 100644 --- a/pallets/ddc-clusters-gov/src/mock.rs +++ b/pallets/ddc-clusters-gov/src/mock.rs @@ -13,7 +13,7 @@ use ddc_primitives::{ StorageNodeParams, DOLLARS, }; use frame_support::{ - parameter_types, + parameter_types,derive_impl, traits::{ fungible::HoldConsideration, ConstBool, ConstU32, ConstU64, EnsureOriginWithArg, EqualPrivilegeOnly, Everything, LinearStoragePrice, Nothing, @@ -85,10 +85,9 @@ impl Convert> for Test { } } +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; @@ -101,14 +100,8 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); type MaxConsumers = ConstU32<16>; } diff --git a/pallets/ddc-clusters/src/mock.rs b/pallets/ddc-clusters/src/mock.rs index 03d0e3317..be220d2e6 100644 --- a/pallets/ddc-clusters/src/mock.rs +++ b/pallets/ddc-clusters/src/mock.rs @@ -7,7 +7,7 @@ use ddc_primitives::{ ClusterId, NodePubKey, }; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, parameter_types,derive_impl, traits::{ConstBool, ConstU32, ConstU64, Everything, Nothing}, weights::constants::RocksDbWeight, }; @@ -142,10 +142,9 @@ parameter_types! { pub static ExistentialDeposit: Balance = 1; } +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; @@ -157,14 +156,8 @@ impl frame_system::Config for Test { type AccountId = AccountId; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); type MaxConsumers = ConstU32<16>; type Lookup = IdentityLookup; } diff --git a/pallets/ddc-customers/src/mock.rs b/pallets/ddc-customers/src/mock.rs index fa4464fe4..06de1b5fa 100644 --- a/pallets/ddc-customers/src/mock.rs +++ b/pallets/ddc-customers/src/mock.rs @@ -7,7 +7,7 @@ use ddc_primitives::{ ClusterProtocolParams, ClusterStatus, NodePubKey, NodeType, }; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, parameter_types,derive_impl, traits::{ConstU32, ConstU64, Everything}, weights::constants::RocksDbWeight, }; @@ -42,10 +42,9 @@ parameter_types! { pub static ExistentialDeposit: Balance = 1; } +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; @@ -58,14 +57,8 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); type MaxConsumers = ConstU32<16>; } diff --git a/pallets/ddc-nodes/src/mock.rs b/pallets/ddc-nodes/src/mock.rs index bd10b849f..09e2067e7 100644 --- a/pallets/ddc-nodes/src/mock.rs +++ b/pallets/ddc-nodes/src/mock.rs @@ -4,7 +4,7 @@ use ddc_primitives::traits::staking::{StakingVisitor, StakingVisitorError}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, parameter_types,derive_impl, traits::{ConstU32, ConstU64, Everything}, weights::constants::RocksDbWeight, }; @@ -41,10 +41,9 @@ parameter_types! { pub static ExistentialDeposit: Balance = 1; } +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; @@ -57,14 +56,8 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); type MaxConsumers = ConstU32<16>; } diff --git a/pallets/ddc-payouts/src/mock.rs b/pallets/ddc-payouts/src/mock.rs index 1144ef24e..604d97d36 100644 --- a/pallets/ddc-payouts/src/mock.rs +++ b/pallets/ddc-payouts/src/mock.rs @@ -14,7 +14,7 @@ use ddc_primitives::{ }; use frame_election_provider_support::SortedListProvider; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, parameter_types,derive_impl, traits::{ConstU32, ConstU64, Everything, ExistenceRequirement, Randomness}, weights::constants::RocksDbWeight, PalletId, @@ -73,10 +73,9 @@ impl Randomness for MockRandomness { } } +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; @@ -89,14 +88,8 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); type MaxConsumers = ConstU32<16>; } diff --git a/pallets/ddc-staking/src/mock.rs b/pallets/ddc-staking/src/mock.rs index 6868deea0..bcd6dae1d 100644 --- a/pallets/ddc-staking/src/mock.rs +++ b/pallets/ddc-staking/src/mock.rs @@ -7,7 +7,7 @@ use ddc_primitives::{ NodeParams, NodePubKey, StorageNodeParams, StorageNodePubKey, }; use frame_support::{ - construct_runtime, + construct_runtime,derive_impl, traits::{ConstBool, ConstU32, ConstU64, Everything, Nothing}, weights::constants::RocksDbWeight, }; @@ -64,10 +64,9 @@ type BalanceOf = <::Currency as Currency< ::AccountId, >>::Balance; +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; @@ -80,14 +79,8 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); type MaxConsumers = ConstU32<16>; } diff --git a/pallets/erc20/src/mock.rs b/pallets/erc20/src/mock.rs index 004d507e5..f4b713908 100644 --- a/pallets/erc20/src/mock.rs +++ b/pallets/erc20/src/mock.rs @@ -1,7 +1,7 @@ #![cfg(test)] use chainbridge as bridge; -use frame_support::{ord_parameter_types, parameter_types, weights::Weight}; +use frame_support::{ord_parameter_types,derive_impl, parameter_types, weights::Weight}; use frame_system::{self as system}; pub use pallet_balances as balances; use sp_core::{hashing::blake2_128, H256}; @@ -21,8 +21,8 @@ parameter_types! { pub const AvailableBlockRatio: Perbill = Perbill::one(); } +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = (); type Origin = Origin; type Call = Call; type Nonce = u64; @@ -34,18 +34,9 @@ impl frame_system::Config for Test { type Event = Event; type BlockHashCount = BlockHashCount; type MaximumBlockWeight = MaximumBlockWeight; - type DbWeight = (); - type BlockExecutionWeight = (); - type ExtrinsicBaseWeight = (); - type MaximumExtrinsicWeight = (); type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; - type Version = (); - type ModuleToIndex = (); type AccountData = balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); } parameter_types! { diff --git a/pallets/erc721/src/mock.rs b/pallets/erc721/src/mock.rs index f0e4c5b23..f802e6cc0 100644 --- a/pallets/erc721/src/mock.rs +++ b/pallets/erc721/src/mock.rs @@ -1,6 +1,6 @@ #![cfg(test)] -use frame_support::{ord_parameter_types, parameter_types, traits::Everything, weights::Weight}; +use frame_support::{ord_parameter_types,derive_impl, parameter_types, traits::Everything, weights::Weight}; use frame_system::{self as system}; pub use pallet_balances as balances; use pallet_chainbridge as bridge; @@ -20,10 +20,9 @@ parameter_types! { pub const AvailableBlockRatio: Perbill = Perbill::one(); } +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; type RuntimeTask = RuntimeTask; @@ -35,15 +34,8 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; } diff --git a/runtime/cere-dev/src/lib.rs b/runtime/cere-dev/src/lib.rs index 00dd9332e..d9940824f 100644 --- a/runtime/cere-dev/src/lib.rs +++ b/runtime/cere-dev/src/lib.rs @@ -32,6 +32,7 @@ use frame_support::{ dispatch::DispatchClass, pallet_prelude::Get, parameter_types, + derive_impl, traits::{ fungible::HoldConsideration, tokens::{PayFromAccount, UnityAssetBalanceConversion}, @@ -222,6 +223,7 @@ parameter_types! { const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct()); +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type BlockWeights = RuntimeBlockWeights; @@ -241,11 +243,8 @@ impl frame_system::Config for Runtime { type Version = Version; type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); type SystemWeightInfo = frame_system::weights::SubstrateWeight; type SS58Prefix = ConstU16<54>; - type OnSetCode = (); type MaxConsumers = ConstU32<16>; } diff --git a/runtime/cere/src/lib.rs b/runtime/cere/src/lib.rs index e2fcd803f..a385c9b53 100644 --- a/runtime/cere/src/lib.rs +++ b/runtime/cere/src/lib.rs @@ -31,6 +31,7 @@ use frame_support::{ dispatch::DispatchClass, pallet_prelude::Get, parameter_types, + derive_impl, traits::{ fungible::HoldConsideration, tokens::{PayFromAccount, UnityAssetBalanceConversion}, @@ -217,6 +218,7 @@ parameter_types! { const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct()); +#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type BlockWeights = RuntimeBlockWeights; @@ -236,11 +238,8 @@ impl frame_system::Config for Runtime { type Version = Version; type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); type SystemWeightInfo = frame_system::weights::SubstrateWeight; type SS58Prefix = ConstU16<54>; - type OnSetCode = (); type MaxConsumers = ConstU32<16>; }