From 726aa430c82e4d3c4fcc07f281bdab48786b6904 Mon Sep 17 00:00:00 2001 From: Anton Gavrilov Date: Thu, 16 Jan 2025 14:23:07 +0100 Subject: [PATCH] Config mocks updated --- chain-extensions/pallet-assets/src/mock.rs | 7 ++++++- pallets/astar-xcm-benchmarks/src/mock.rs | 5 ++++- pallets/collator-selection/src/mock.rs | 5 ++++- pallets/collective-proxy/src/mock.rs | 4 +++- pallets/dapp-staking/src/test/mock.rs | 2 ++ pallets/dynamic-evm-base-fee/src/mock.rs | 5 ++++- pallets/ethereum-checked/src/mock.rs | 5 ++++- pallets/inflation/src/mock.rs | 4 +++- pallets/price-aggregator/src/mock.rs | 4 +++- pallets/static-price-provider/src/mock.rs | 4 +++- pallets/unified-accounts/src/mock.rs | 5 ++++- pallets/xc-asset-config/src/mock.rs | 6 +++++- precompiles/assets-erc20/src/mock.rs | 6 +++++- precompiles/dapp-staking/src/test/mock.rs | 5 ++++- precompiles/dispatch-lockdrop/src/mock.rs | 7 ++++++- precompiles/sr25519/src/mock.rs | 5 ++++- precompiles/substrate-ecdsa/src/mock.rs | 5 ++++- precompiles/unified-accounts/src/mock.rs | 7 ++++++- precompiles/xcm/src/mock.rs | 6 +++++- tests/xcm-simulator/src/mocks/parachain.rs | 7 ++++++- tests/xcm-simulator/src/mocks/relay_chain.rs | 4 +++- 21 files changed, 88 insertions(+), 20 deletions(-) diff --git a/chain-extensions/pallet-assets/src/mock.rs b/chain-extensions/pallet-assets/src/mock.rs index 810a42d550..fa9421fe78 100644 --- a/chain-extensions/pallet-assets/src/mock.rs +++ b/chain-extensions/pallet-assets/src/mock.rs @@ -19,7 +19,7 @@ use crate::AssetsExtension; use frame_support::traits::{AsEnsureOriginWithArg, ConstU128, Currency, Randomness}; use frame_support::{ - parameter_types, + derive_impl, parameter_types, traits::{ConstU32, ConstU64, Nothing}, weights::Weight, }; @@ -47,6 +47,7 @@ parameter_types! { Weight::from_parts(2_000_000_000_000, u64::MAX), ); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = BlockWeights; @@ -96,6 +97,7 @@ impl Randomness for DummyDeprecatedRandomness { } } +#[derive_impl(pallet_contracts::config_preludes::TestDefaultConfig)] impl pallet_contracts::Config for Test { type Time = Timestamp; type Randomness = DummyDeprecatedRandomness; @@ -137,6 +139,7 @@ parameter_types! { pub static ExistentialDeposit: u64 = 1; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = (); type MaxReserves = (); @@ -153,6 +156,7 @@ impl pallet_balances::Config for Test { type MaxFreezes = ConstU32<0>; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Test { type Moment = u64; type OnTimestampSet = (); @@ -160,6 +164,7 @@ impl pallet_timestamp::Config for Test { type WeightInfo = (); } +#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] impl pallet_assets::Config for Test { type RuntimeEvent = RuntimeEvent; type Balance = Balance; diff --git a/pallets/astar-xcm-benchmarks/src/mock.rs b/pallets/astar-xcm-benchmarks/src/mock.rs index 1332464f0b..651e613083 100644 --- a/pallets/astar-xcm-benchmarks/src/mock.rs +++ b/pallets/astar-xcm-benchmarks/src/mock.rs @@ -22,7 +22,7 @@ use crate::{fungible, generic, *}; use astar_primitives::xcm::ReserveAssetFilter; use frame_benchmarking::BenchmarkError; use frame_support::{ - assert_ok, parameter_types, + assert_ok, derive_impl, parameter_types, traits::{fungible::ItemOf, AsEnsureOriginWithArg, Everything, Nothing}, weights::Weight, }; @@ -104,6 +104,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, u64::MAX)); pub UniversalLocation: InteriorLocation = Here; } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = Everything; type BlockWeights = (); @@ -140,6 +141,7 @@ parameter_types! { pub const ExistentialDeposit: u64 = 10; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = (); type MaxReserves = (); @@ -156,6 +158,7 @@ impl pallet_balances::Config for Test { type MaxFreezes = ConstU32<0>; } +#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] impl pallet_assets::Config for Test { type RuntimeEvent = RuntimeEvent; type Balance = Balance; diff --git a/pallets/collator-selection/src/mock.rs b/pallets/collator-selection/src/mock.rs index b7ce8f3955..b2dba7f142 100644 --- a/pallets/collator-selection/src/mock.rs +++ b/pallets/collator-selection/src/mock.rs @@ -18,7 +18,7 @@ use super::*; use crate as collator_selection; use frame_support::{ - ord_parameter_types, parameter_types, + derive_impl, ord_parameter_types, parameter_types, traits::{ConstU32, FindAuthor, ValidatorRegistration}, PalletId, }; @@ -51,6 +51,7 @@ parameter_types! { pub const SS58Prefix: u8 = 42; } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -88,6 +89,7 @@ parameter_types! { pub const MaxReserves: u32 = 50; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type Balance = u64; type RuntimeEvent = RuntimeEvent; @@ -123,6 +125,7 @@ parameter_types! { pub const MinimumPeriod: u64 = 1; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Test { type Moment = u64; type OnTimestampSet = Aura; diff --git a/pallets/collective-proxy/src/mock.rs b/pallets/collective-proxy/src/mock.rs index 794e3677c1..0109b8c8fe 100644 --- a/pallets/collective-proxy/src/mock.rs +++ b/pallets/collective-proxy/src/mock.rs @@ -20,7 +20,7 @@ use crate::{self as pallet_collective_proxy}; use astar_primitives::{Balance, BlockNumber}; use frame_support::{ - construct_runtime, ord_parameter_types, parameter_types, + construct_runtime, derive_impl, ord_parameter_types, parameter_types, traits::{ConstU128, ConstU32, InstanceFilter}, weights::Weight, }; @@ -53,6 +53,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -85,6 +86,7 @@ impl frame_system::Config for Test { type PostTransactions = (); } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = ConstU32<4>; type MaxReserves = (); diff --git a/pallets/dapp-staking/src/test/mock.rs b/pallets/dapp-staking/src/test/mock.rs index 1a1b1532cd..cafcfdb3bf 100644 --- a/pallets/dapp-staking/src/test/mock.rs +++ b/pallets/dapp-staking/src/test/mock.rs @@ -66,6 +66,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -98,6 +99,7 @@ impl frame_system::Config for Test { type PostTransactions = (); } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = ConstU32<4>; type MaxReserves = (); diff --git a/pallets/dynamic-evm-base-fee/src/mock.rs b/pallets/dynamic-evm-base-fee/src/mock.rs index 64c79d4e2c..a0c28fce75 100644 --- a/pallets/dynamic-evm-base-fee/src/mock.rs +++ b/pallets/dynamic-evm-base-fee/src/mock.rs @@ -22,7 +22,7 @@ use super::*; use crate as pallet_dynamic_evm_base_fee; use frame_support::{ - construct_runtime, parameter_types, storage, + construct_runtime, derive_impl, parameter_types, storage, traits::{ConstU128, ConstU32, ConstU64, Get}, weights::constants::RocksDbWeight, }; @@ -42,6 +42,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -74,6 +75,7 @@ impl frame_system::Config for TestRuntime { type PostTransactions = (); } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { type MaxLocks = ConstU32<4>; type MaxReserves = (); @@ -90,6 +92,7 @@ impl pallet_balances::Config for TestRuntime { type MaxFreezes = ConstU32<0>; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for TestRuntime { type Moment = u64; type OnTimestampSet = (); diff --git a/pallets/ethereum-checked/src/mock.rs b/pallets/ethereum-checked/src/mock.rs index fc68a7231a..11da59d4cb 100644 --- a/pallets/ethereum-checked/src/mock.rs +++ b/pallets/ethereum-checked/src/mock.rs @@ -24,7 +24,7 @@ use crate as pallet_ethereum_checked; use ethereum_types::H256; use frame_support::{ - assert_ok, construct_runtime, parameter_types, + assert_ok, construct_runtime, derive_impl, parameter_types, traits::{ConstU128, ConstU64, FindAuthor}, weights::Weight, }; @@ -41,6 +41,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -73,6 +74,7 @@ impl frame_system::Config for TestRuntime { type PostTransactions = (); } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { type MaxLocks = ConstU32<4>; type MaxReserves = (); @@ -89,6 +91,7 @@ impl pallet_balances::Config for TestRuntime { type MaxFreezes = ConstU32<0>; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for TestRuntime { type Moment = u64; type OnTimestampSet = (); diff --git a/pallets/inflation/src/mock.rs b/pallets/inflation/src/mock.rs index db8c76edef..5132f77f43 100644 --- a/pallets/inflation/src/mock.rs +++ b/pallets/inflation/src/mock.rs @@ -22,7 +22,7 @@ use crate::{ }; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, derive_impl, parameter_types, traits::{fungible::Balanced, ConstU128, ConstU32, Hooks}, weights::Weight, PalletId, @@ -57,6 +57,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -89,6 +90,7 @@ impl frame_system::Config for Test { type PostTransactions = (); } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = ConstU32<4>; type MaxReserves = (); diff --git a/pallets/price-aggregator/src/mock.rs b/pallets/price-aggregator/src/mock.rs index 4524d0e5c3..6ef9c221c3 100644 --- a/pallets/price-aggregator/src/mock.rs +++ b/pallets/price-aggregator/src/mock.rs @@ -21,7 +21,7 @@ use crate::{ }; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, derive_impl, parameter_types, traits::{ConstU128, ConstU32, Hooks}, weights::Weight, }; @@ -43,6 +43,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -75,6 +76,7 @@ impl frame_system::Config for Test { type PostTransactions = (); } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = ConstU32<4>; type MaxReserves = (); diff --git a/pallets/static-price-provider/src/mock.rs b/pallets/static-price-provider/src/mock.rs index a8cb26ef2f..a386e2d397 100644 --- a/pallets/static-price-provider/src/mock.rs +++ b/pallets/static-price-provider/src/mock.rs @@ -19,7 +19,7 @@ use crate::{self as pallet_static_price_provider}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, derive_impl, parameter_types, traits::{ConstU128, ConstU32}, weights::Weight, }; @@ -41,6 +41,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -73,6 +74,7 @@ impl frame_system::Config for Test { type PostTransactions = (); } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = ConstU32<4>; type MaxReserves = (); diff --git a/pallets/unified-accounts/src/mock.rs b/pallets/unified-accounts/src/mock.rs index 33d55e4827..8dddc9d235 100644 --- a/pallets/unified-accounts/src/mock.rs +++ b/pallets/unified-accounts/src/mock.rs @@ -22,7 +22,7 @@ use super::*; use crate as pallet_unified_accounts; use astar_primitives::evm::HashedDefaultMappings; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, derive_impl, parameter_types, traits::{ConstU64, FindAuthor}, weights::Weight, }; @@ -41,6 +41,7 @@ parameter_types! { pub const ExistentialDeposit: u128 = 100; } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -73,6 +74,7 @@ impl frame_system::Config for TestRuntime { type PostTransactions = (); } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { type MaxLocks = ConstU32<4>; type MaxReserves = (); @@ -89,6 +91,7 @@ impl pallet_balances::Config for TestRuntime { type MaxFreezes = ConstU32<0>; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for TestRuntime { type Moment = u64; type OnTimestampSet = (); diff --git a/pallets/xc-asset-config/src/mock.rs b/pallets/xc-asset-config/src/mock.rs index fe03fd9ae8..21a7f5943e 100644 --- a/pallets/xc-asset-config/src/mock.rs +++ b/pallets/xc-asset-config/src/mock.rs @@ -18,7 +18,9 @@ use crate::{self as pallet_xc_asset_config}; -use frame_support::{construct_runtime, parameter_types, traits::ConstU32, weights::Weight}; +use frame_support::{ + construct_runtime, derive_impl, parameter_types, traits::ConstU32, weights::Weight, +}; use sp_core::H256; use sp_io::TestExternalities; @@ -48,6 +50,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -85,6 +88,7 @@ parameter_types! { pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = MaxLocks; type MaxReserves = (); diff --git a/precompiles/assets-erc20/src/mock.rs b/precompiles/assets-erc20/src/mock.rs index cbc54f1292..d3c4b5a98e 100644 --- a/precompiles/assets-erc20/src/mock.rs +++ b/precompiles/assets-erc20/src/mock.rs @@ -38,7 +38,7 @@ use super::*; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, derive_impl, parameter_types, traits::{AsEnsureOriginWithArg, ConstU64, Everything}, weights::Weight, }; @@ -92,6 +92,7 @@ parameter_types! { pub const SS58Prefix: u8 = 42; } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); @@ -128,6 +129,7 @@ parameter_types! { pub const MinimumPeriod: u64 = 5; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime { type Moment = u64; type OnTimestampSet = (); @@ -139,6 +141,7 @@ parameter_types! { pub const ExistentialDeposit: u128 = 1; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = (); @@ -198,6 +201,7 @@ parameter_types! { pub const MetadataDepositPerByte: Balance = 0; } +#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] impl pallet_assets::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; diff --git a/precompiles/dapp-staking/src/test/mock.rs b/precompiles/dapp-staking/src/test/mock.rs index 04db72aa52..b1dfa35f27 100644 --- a/precompiles/dapp-staking/src/test/mock.rs +++ b/precompiles/dapp-staking/src/test/mock.rs @@ -20,7 +20,7 @@ use crate::*; use fp_evm::{IsPrecompileResult, Precompile}; use frame_support::{ - assert_ok, construct_runtime, parameter_types, + assert_ok, construct_runtime, derive_impl, parameter_types, traits::{ fungible::{Mutate as FunMutate, Unbalanced as FunUnbalanced}, ConstBool, ConstU128, ConstU64, Hooks, @@ -77,6 +77,7 @@ parameter_types! { }; } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -109,6 +110,7 @@ impl frame_system::Config for Test { type PostTransactions = (); } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { type MaxLocks = ConstU32<4>; type MaxReserves = (); @@ -182,6 +184,7 @@ impl pallet_evm::Config for Test { type SuicideQuickClearLimit = ConstU32<0>; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Test { type Moment = u64; type OnTimestampSet = (); diff --git a/precompiles/dispatch-lockdrop/src/mock.rs b/precompiles/dispatch-lockdrop/src/mock.rs index bb7be97ecd..f1b9b3ea68 100644 --- a/precompiles/dispatch-lockdrop/src/mock.rs +++ b/precompiles/dispatch-lockdrop/src/mock.rs @@ -20,7 +20,9 @@ use super::*; use std::marker::PhantomData; use fp_evm::{IsPrecompileResult, Precompile}; -use frame_support::{construct_runtime, parameter_types, traits::ConstU64, weights::Weight}; +use frame_support::{ + construct_runtime, derive_impl, parameter_types, traits::ConstU64, weights::Weight, +}; pub use pallet_evm::{ AddressMapping, EnsureAddressNever, EnsureAddressRoot, PrecompileResult, PrecompileSet, }; @@ -52,6 +54,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -127,6 +130,7 @@ parameter_types! { pub const ExistentialDeposit: u128 = 1; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { type MaxReserves = (); type ReserveIdentifier = (); @@ -147,6 +151,7 @@ parameter_types! { pub const MinimumPeriod: u64 = 5; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for TestRuntime { type Moment = u64; type OnTimestampSet = (); diff --git a/precompiles/sr25519/src/mock.rs b/precompiles/sr25519/src/mock.rs index b6144ec350..9fb1fca469 100644 --- a/precompiles/sr25519/src/mock.rs +++ b/precompiles/sr25519/src/mock.rs @@ -22,7 +22,7 @@ use super::*; use fp_evm::{IsPrecompileResult, Precompile}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, derive_impl, parameter_types, traits::{ConstU32, ConstU64, Everything}, weights::Weight, }; @@ -109,6 +109,7 @@ parameter_types! { pub const SS58Prefix: u8 = 42; } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); @@ -168,6 +169,7 @@ parameter_types! { pub const MinimumPeriod: u64 = 5; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime { type Moment = u64; type OnTimestampSet = (); @@ -179,6 +181,7 @@ parameter_types! { pub const ExistentialDeposit: u128 = 1; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = (); diff --git a/precompiles/substrate-ecdsa/src/mock.rs b/precompiles/substrate-ecdsa/src/mock.rs index 362095bb58..02796df6fc 100644 --- a/precompiles/substrate-ecdsa/src/mock.rs +++ b/precompiles/substrate-ecdsa/src/mock.rs @@ -22,7 +22,7 @@ use super::*; use fp_evm::{IsPrecompileResult, Precompile}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, derive_impl, parameter_types, traits::{ConstU32, ConstU64, Everything}, weights::Weight, }; @@ -109,6 +109,7 @@ parameter_types! { pub const SS58Prefix: u8 = 42; } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); @@ -168,6 +169,7 @@ parameter_types! { pub const MinimumPeriod: u64 = 5; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime { type Moment = u64; type OnTimestampSet = (); @@ -179,6 +181,7 @@ parameter_types! { pub const ExistentialDeposit: u128 = 1; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = (); diff --git a/precompiles/unified-accounts/src/mock.rs b/precompiles/unified-accounts/src/mock.rs index db8f6f0d1d..3f0287a84a 100644 --- a/precompiles/unified-accounts/src/mock.rs +++ b/precompiles/unified-accounts/src/mock.rs @@ -19,7 +19,9 @@ use super::*; use fp_evm::{IsPrecompileResult, Precompile}; -use frame_support::{construct_runtime, parameter_types, traits::ConstU64, weights::Weight}; +use frame_support::{ + construct_runtime, derive_impl, parameter_types, traits::ConstU64, weights::Weight, +}; pub use pallet_evm::{EnsureAddressNever, EnsureAddressRoot, PrecompileResult, PrecompileSet}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; @@ -112,6 +114,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -173,6 +176,7 @@ parameter_types! { pub const ExistentialDeposit: u128 = 1; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { type MaxReserves = (); type ReserveIdentifier = (); @@ -193,6 +197,7 @@ parameter_types! { pub const MinimumPeriod: u64 = 5; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for TestRuntime { type Moment = u64; type OnTimestampSet = (); diff --git a/precompiles/xcm/src/mock.rs b/precompiles/xcm/src/mock.rs index 38f4a8b1b5..16a6cad553 100644 --- a/precompiles/xcm/src/mock.rs +++ b/precompiles/xcm/src/mock.rs @@ -22,7 +22,7 @@ use super::*; use fp_evm::{IsPrecompileResult, Precompile}; use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, derive_impl, parameter_types, traits::{AsEnsureOriginWithArg, ConstU64, Everything, Nothing}, weights::Weight, }; @@ -215,6 +215,7 @@ parameter_types! { pub const SS58Prefix: u8 = 42; } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); @@ -279,6 +280,7 @@ parameter_types! { pub const MinimumPeriod: u64 = 5; } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime { type Moment = u64; type OnTimestampSet = (); @@ -290,6 +292,7 @@ parameter_types! { pub const ExistentialDeposit: u128 = 1; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { type MaxReserves = (); type ReserveIdentifier = (); @@ -317,6 +320,7 @@ parameter_types! { pub const MetadataDepositPerByte: Balance = 0; } +#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] impl pallet_assets::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; diff --git a/tests/xcm-simulator/src/mocks/parachain.rs b/tests/xcm-simulator/src/mocks/parachain.rs index 26d2118936..a944e7f81b 100644 --- a/tests/xcm-simulator/src/mocks/parachain.rs +++ b/tests/xcm-simulator/src/mocks/parachain.rs @@ -19,7 +19,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use frame_support::{ - construct_runtime, + construct_runtime, derive_impl, dispatch::DispatchClass, parameter_types, traits::{ @@ -80,6 +80,7 @@ parameter_types! { pub const BlockHashCount: u64 = 250; } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; @@ -118,6 +119,7 @@ parameter_types! { pub const MaxReserves: u32 = 50; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { type MaxLocks = MaxLocks; type Balance = Balance; @@ -141,6 +143,7 @@ impl pallet_utility::Config for Runtime { type WeightInfo = pallet_utility::weights::SubstrateWeight; } +#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] impl pallet_assets::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; @@ -164,6 +167,7 @@ impl pallet_assets::Config for Runtime { type BenchmarkHelper = (); } +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime { type Moment = u64; type OnTimestampSet = (); @@ -239,6 +243,7 @@ impl Contains for CallFilter { } } +#[derive_impl(pallet_contracts::config_preludes::TestDefaultConfig)] impl pallet_contracts::Config for Runtime { type Time = Timestamp; type Randomness = Randomness; diff --git a/tests/xcm-simulator/src/mocks/relay_chain.rs b/tests/xcm-simulator/src/mocks/relay_chain.rs index 6dcba95a87..cd893b1963 100644 --- a/tests/xcm-simulator/src/mocks/relay_chain.rs +++ b/tests/xcm-simulator/src/mocks/relay_chain.rs @@ -17,7 +17,7 @@ // along with Astar. If not, see . use frame_support::{ - construct_runtime, parameter_types, + construct_runtime, derive_impl, parameter_types, traits::{ConstU32, Everything, Nothing, ProcessMessage, ProcessMessageError}, weights::{Weight, WeightMeter}, }; @@ -47,6 +47,7 @@ parameter_types! { pub const BlockHashCount: u64 = 250; } +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; @@ -85,6 +86,7 @@ parameter_types! { pub const MaxReserves: u32 = 50; } +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { type MaxLocks = MaxLocks; type Balance = Balance;