From 5fec9551d1248504768ec3403dc00e0c39468284 Mon Sep 17 00:00:00 2001 From: Anton Gavrilov Date: Thu, 16 Jan 2025 14:23:07 +0100 Subject: [PATCH 1/3] 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; From 3a9bfe46013f3bf329310751e9d216b04d3d75fb Mon Sep 17 00:00:00 2001 From: Anton Gavrilov Date: Fri, 17 Jan 2025 13:54:35 +0100 Subject: [PATCH 2/3] Cleanup default parameters --- chain-extensions/pallet-assets/src/mock.rs | 31 -------------------- pallets/astar-xcm-benchmarks/src/mock.rs | 21 ------------- pallets/collator-selection/src/mock.rs | 21 ------------- pallets/collective-proxy/src/mock.rs | 18 ------------ pallets/dapp-staking/src/test/mock.rs | 18 ------------ pallets/dynamic-evm-base-fee/src/mock.rs | 21 ------------- pallets/ethereum-checked/src/mock.rs | 22 -------------- pallets/inflation/src/mock.rs | 19 ------------ pallets/price-aggregator/src/mock.rs | 18 ------------ pallets/static-price-provider/src/mock.rs | 19 ------------ pallets/unified-accounts/src/mock.rs | 21 ------------- pallets/vesting-mbm/src/mock.rs | 1 - pallets/xc-asset-config/src/mock.rs | 19 ------------ precompiles/assets-erc20/src/mock.rs | 23 --------------- precompiles/dapp-staking/src/test/mock.rs | 21 ------------- precompiles/dispatch-lockdrop/src/mock.rs | 23 --------------- precompiles/sr25519/src/mock.rs | 22 -------------- precompiles/substrate-ecdsa/src/mock.rs | 21 ------------- precompiles/unified-accounts/src/mock.rs | 23 --------------- precompiles/xcm/src/mock.rs | 24 --------------- tests/xcm-simulator/src/mocks/parachain.rs | 29 ------------------ tests/xcm-simulator/src/mocks/relay_chain.rs | 19 ------------ 22 files changed, 454 deletions(-) diff --git a/chain-extensions/pallet-assets/src/mock.rs b/chain-extensions/pallet-assets/src/mock.rs index fa9421fe78..ae6504e371 100644 --- a/chain-extensions/pallet-assets/src/mock.rs +++ b/chain-extensions/pallet-assets/src/mock.rs @@ -49,12 +49,8 @@ parameter_types! { } #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = BlockWeights; - type BlockLength = (); - type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Nonce = u32; type Block = Block; type Hash = H256; type RuntimeCall = RuntimeCall; @@ -63,21 +59,9 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } parameter_types! { @@ -107,7 +91,6 @@ impl pallet_contracts::Config for Test { type CallFilter = Nothing; type CallStack = [Frame; 5]; type WeightPrice = Self; - type WeightInfo = (); type ChainExtension = AssetsExtension; type Schedule = Schedule; type DepositPerByte = DepositPerByte; @@ -119,15 +102,10 @@ impl pallet_contracts::Config for Test { type UnsafeUnstableInterface = UnstableInterface; type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; - type Debug = (); - type Environment = (); type MaxDelegateDependencies = MaxDelegateDependencies; - type Migrations = (); type RuntimeHoldReason = RuntimeHoldReason; - type Xcm = (); type UploadOrigin = EnsureSigned; type InstantiateOrigin = EnsureSigned; - type ApiVersion = (); type MaxTransientStorageSize = ConstU32<{ 1 * 1024 * 1024 }>; } @@ -146,22 +124,16 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Test { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = ConstU64<1>; - type WeightInfo = (); } #[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] @@ -180,9 +152,6 @@ impl pallet_assets::Config for Test { type ApprovalDeposit = ConstU128<1>; type StringLimit = ConstU32<50>; type Freezer = (); - type WeightInfo = (); - type CallbackHandle = (); - type Extra = (); type RemoveItemsLimit = ConstU32<5>; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); diff --git a/pallets/astar-xcm-benchmarks/src/mock.rs b/pallets/astar-xcm-benchmarks/src/mock.rs index 651e613083..462ac400cb 100644 --- a/pallets/astar-xcm-benchmarks/src/mock.rs +++ b/pallets/astar-xcm-benchmarks/src/mock.rs @@ -106,11 +106,7 @@ parameter_types! { } #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); type Block = Block; - type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type Hash = H256; @@ -120,21 +116,10 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - 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 RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } parameter_types! { @@ -147,14 +132,11 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type DustRemoval = (); type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } @@ -174,10 +156,7 @@ impl pallet_assets::Config for Test { type ApprovalDeposit = ConstU64<10>; type StringLimit = ConstU32<50>; type Freezer = (); - type Extra = (); type RemoveItemsLimit = ConstU32<100>; - type CallbackHandle = (); - type WeightInfo = (); #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); } diff --git a/pallets/collator-selection/src/mock.rs b/pallets/collator-selection/src/mock.rs index b2dba7f142..f1a1082072 100644 --- a/pallets/collator-selection/src/mock.rs +++ b/pallets/collator-selection/src/mock.rs @@ -53,10 +53,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; type Nonce = u64; @@ -67,21 +63,10 @@ impl system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } parameter_types! { @@ -91,17 +76,13 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type Balance = u64; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type MaxLocks = (); type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = RuntimeHoldReason; - type RuntimeFreezeReason = (); type FreezeIdentifier = (); type MaxFreezes = ConstU32<0>; } @@ -127,10 +108,8 @@ parameter_types! { #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Test { - type Moment = u64; type OnTimestampSet = Aura; type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); } impl pallet_aura::Config for Test { diff --git a/pallets/collective-proxy/src/mock.rs b/pallets/collective-proxy/src/mock.rs index 0109b8c8fe..7164cb3c60 100644 --- a/pallets/collective-proxy/src/mock.rs +++ b/pallets/collective-proxy/src/mock.rs @@ -55,9 +55,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -68,22 +65,9 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] @@ -93,14 +77,12 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = RuntimeFreezeReason; type RuntimeFreezeReason = RuntimeFreezeReason; type MaxFreezes = ConstU32<1>; - type WeightInfo = (); } parameter_types! { diff --git a/pallets/dapp-staking/src/test/mock.rs b/pallets/dapp-staking/src/test/mock.rs index cafcfdb3bf..0dc4f6400e 100644 --- a/pallets/dapp-staking/src/test/mock.rs +++ b/pallets/dapp-staking/src/test/mock.rs @@ -68,9 +68,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -81,22 +78,10 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); type MultiBlockMigrator = MultiBlockMigrations; - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] @@ -106,14 +91,12 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ConstU128; type AccountStore = System; type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = RuntimeFreezeReason; type RuntimeFreezeReason = RuntimeFreezeReason; type MaxFreezes = ConstU32<1>; - type WeightInfo = (); } parameter_types! { @@ -127,7 +110,6 @@ impl pallet_migrations::Config for Test { (crate::migration::LazyMigration>,); #[cfg(feature = "runtime-benchmarks")] type Migrations = pallet_migrations::mock_helpers::MockedMigrations; - type MigrationStatusHandler = (); type MaxServiceWeight = MaxServiceWeight; } diff --git a/pallets/dynamic-evm-base-fee/src/mock.rs b/pallets/dynamic-evm-base-fee/src/mock.rs index a0c28fce75..91065eecde 100644 --- a/pallets/dynamic-evm-base-fee/src/mock.rs +++ b/pallets/dynamic-evm-base-fee/src/mock.rs @@ -44,9 +44,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -58,21 +55,9 @@ impl frame_system::Config for TestRuntime { type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU32<250>; type DbWeight = RocksDbWeight; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] @@ -82,22 +67,16 @@ impl pallet_balances::Config for TestRuntime { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ConstU128<2>; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for TestRuntime { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = ConstU64<3>; - type WeightInfo = (); } parameter_types! { diff --git a/pallets/ethereum-checked/src/mock.rs b/pallets/ethereum-checked/src/mock.rs index 11da59d4cb..b5dd744c73 100644 --- a/pallets/ethereum-checked/src/mock.rs +++ b/pallets/ethereum-checked/src/mock.rs @@ -43,9 +43,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -56,22 +53,9 @@ impl frame_system::Config for TestRuntime { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] @@ -81,22 +65,16 @@ impl pallet_balances::Config for TestRuntime { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ConstU128<2>; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for TestRuntime { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = ConstU64<3>; - type WeightInfo = (); } pub struct MockFeeCalculator; diff --git a/pallets/inflation/src/mock.rs b/pallets/inflation/src/mock.rs index 5132f77f43..f6b210e624 100644 --- a/pallets/inflation/src/mock.rs +++ b/pallets/inflation/src/mock.rs @@ -59,9 +59,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -72,22 +69,9 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] @@ -97,13 +81,10 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } // Dummy accounts used to simulate reward beneficiaries balances diff --git a/pallets/price-aggregator/src/mock.rs b/pallets/price-aggregator/src/mock.rs index 6ef9c221c3..67eb78d097 100644 --- a/pallets/price-aggregator/src/mock.rs +++ b/pallets/price-aggregator/src/mock.rs @@ -45,9 +45,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -58,22 +55,9 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] @@ -83,10 +67,8 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); type RuntimeFreezeReason = RuntimeFreezeReason; diff --git a/pallets/static-price-provider/src/mock.rs b/pallets/static-price-provider/src/mock.rs index a386e2d397..f33ed155dd 100644 --- a/pallets/static-price-provider/src/mock.rs +++ b/pallets/static-price-provider/src/mock.rs @@ -43,9 +43,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -56,22 +53,9 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] @@ -81,13 +65,10 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } diff --git a/pallets/unified-accounts/src/mock.rs b/pallets/unified-accounts/src/mock.rs index 8dddc9d235..93113e4ffd 100644 --- a/pallets/unified-accounts/src/mock.rs +++ b/pallets/unified-accounts/src/mock.rs @@ -43,9 +43,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -56,22 +53,10 @@ impl frame_system::Config for TestRuntime { type Lookup = (AccountIdLookup, UnifiedAccounts); type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); type OnKilledAccount = KillAccountMapping; - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] @@ -81,22 +66,16 @@ impl pallet_balances::Config for TestRuntime { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for TestRuntime { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = ConstU64<3>; - type WeightInfo = (); } pub struct MockFeeCalculator; diff --git a/pallets/vesting-mbm/src/mock.rs b/pallets/vesting-mbm/src/mock.rs index 572fc94f84..95062f474d 100644 --- a/pallets/vesting-mbm/src/mock.rs +++ b/pallets/vesting-mbm/src/mock.rs @@ -64,7 +64,6 @@ impl pallet_migrations::Config for Runtime { type Migrations = (crate::LazyMigration>,); #[cfg(feature = "runtime-benchmarks")] type Migrations = pallet_migrations::mock_helpers::MockedMigrations; - type MigrationStatusHandler = (); type MaxServiceWeight = MaxServiceWeight; } diff --git a/pallets/xc-asset-config/src/mock.rs b/pallets/xc-asset-config/src/mock.rs index 21a7f5943e..6247c0ae82 100644 --- a/pallets/xc-asset-config/src/mock.rs +++ b/pallets/xc-asset-config/src/mock.rs @@ -52,9 +52,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -65,22 +62,9 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } parameter_types! { @@ -95,12 +79,9 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; - type RuntimeFreezeReason = (); type FreezeIdentifier = (); type MaxFreezes = ConstU32<0>; } diff --git a/precompiles/assets-erc20/src/mock.rs b/precompiles/assets-erc20/src/mock.rs index d3c4b5a98e..ff894a7ad6 100644 --- a/precompiles/assets-erc20/src/mock.rs +++ b/precompiles/assets-erc20/src/mock.rs @@ -94,8 +94,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { - type BaseCallFilter = Everything; - type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type Block = Block; @@ -106,23 +104,10 @@ impl frame_system::Config for Runtime { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type BlockWeights = (); - type BlockLength = (); type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } parameter_types! { @@ -131,10 +116,7 @@ parameter_types! { #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); } parameter_types! { @@ -148,13 +130,10 @@ impl pallet_balances::Config for Runtime { type MaxLocks = (); type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } @@ -215,12 +194,10 @@ impl pallet_assets::Config for Runtime { type ApprovalDeposit = ApprovalDeposit; type StringLimit = AssetsStringLimit; type Freezer = (); - type Extra = (); type CreateOrigin = AsEnsureOriginWithArg>; type WeightInfo = pallet_assets::weights::SubstrateWeight; type RemoveItemsLimit = ConstU32<0>; type AssetIdParameter = AssetId; - type CallbackHandle = (); #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); } diff --git a/precompiles/dapp-staking/src/test/mock.rs b/precompiles/dapp-staking/src/test/mock.rs index b1dfa35f27..62eb9d5c08 100644 --- a/precompiles/dapp-staking/src/test/mock.rs +++ b/precompiles/dapp-staking/src/test/mock.rs @@ -79,9 +79,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -92,22 +89,9 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] @@ -117,14 +101,12 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = RuntimeFreezeReason; type RuntimeFreezeReason = RuntimeFreezeReason; type MaxFreezes = ConstU32<1>; - type WeightInfo = (); } pub fn precompile_address() -> H160 { @@ -186,10 +168,7 @@ impl pallet_evm::Config for Test { #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Test { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = ConstU64<5>; - type WeightInfo = (); } type MockSmartContract = SmartContract<::AccountId>; diff --git a/precompiles/dispatch-lockdrop/src/mock.rs b/precompiles/dispatch-lockdrop/src/mock.rs index f1b9b3ea68..cb0a9d3b7f 100644 --- a/precompiles/dispatch-lockdrop/src/mock.rs +++ b/precompiles/dispatch-lockdrop/src/mock.rs @@ -56,9 +56,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -69,22 +66,9 @@ impl frame_system::Config for TestRuntime { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } pub struct WhitelistedCalls; @@ -133,17 +117,13 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { type MaxReserves = (); - type ReserveIdentifier = (); type MaxLocks = (); type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } @@ -153,10 +133,7 @@ parameter_types! { #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for TestRuntime { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); } parameter_types! { diff --git a/precompiles/sr25519/src/mock.rs b/precompiles/sr25519/src/mock.rs index 9fb1fca469..47d2c4f3f4 100644 --- a/precompiles/sr25519/src/mock.rs +++ b/precompiles/sr25519/src/mock.rs @@ -111,8 +111,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { - type BaseCallFilter = Everything; - type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type Block = Block; @@ -123,23 +121,10 @@ impl frame_system::Config for Runtime { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type BlockWeights = (); - type BlockLength = (); type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive(Debug, Clone, Copy)] @@ -171,10 +156,7 @@ parameter_types! { #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); } parameter_types! { @@ -184,17 +166,13 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { type MaxReserves = (); - type ReserveIdentifier = (); type MaxLocks = (); type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } diff --git a/precompiles/substrate-ecdsa/src/mock.rs b/precompiles/substrate-ecdsa/src/mock.rs index 02796df6fc..b2c6cb7571 100644 --- a/precompiles/substrate-ecdsa/src/mock.rs +++ b/precompiles/substrate-ecdsa/src/mock.rs @@ -111,8 +111,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { - type BaseCallFilter = Everything; - type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type Block = Block; @@ -123,23 +121,10 @@ impl frame_system::Config for Runtime { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type BlockWeights = (); - type BlockLength = (); type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive(Debug, Clone, Copy)] @@ -171,10 +156,7 @@ parameter_types! { #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); } parameter_types! { @@ -188,13 +170,10 @@ impl pallet_balances::Config for Runtime { type MaxLocks = (); type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } diff --git a/precompiles/unified-accounts/src/mock.rs b/precompiles/unified-accounts/src/mock.rs index 3f0287a84a..82f82d010e 100644 --- a/precompiles/unified-accounts/src/mock.rs +++ b/precompiles/unified-accounts/src/mock.rs @@ -116,9 +116,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; @@ -129,22 +126,9 @@ impl frame_system::Config for TestRuntime { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive(Debug, Clone, Copy)] pub struct TestPrecompileSet(PhantomData); @@ -179,16 +163,12 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { type MaxReserves = (); - type ReserveIdentifier = (); type MaxLocks = (); type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; - type RuntimeFreezeReason = (); type FreezeIdentifier = (); type MaxFreezes = ConstU32<0>; } @@ -199,10 +179,7 @@ parameter_types! { #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for TestRuntime { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); } parameter_types! { diff --git a/precompiles/xcm/src/mock.rs b/precompiles/xcm/src/mock.rs index 16a6cad553..beea54d8df 100644 --- a/precompiles/xcm/src/mock.rs +++ b/precompiles/xcm/src/mock.rs @@ -217,8 +217,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { - type BaseCallFilter = Everything; - type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type Block = Block; @@ -229,23 +227,10 @@ impl frame_system::Config for Runtime { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type BlockWeights = (); - type BlockLength = (); type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } #[derive(Debug, Clone, Copy)] @@ -282,10 +267,7 @@ parameter_types! { #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); } parameter_types! { @@ -295,17 +277,13 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { type MaxReserves = (); - type ReserveIdentifier = (); type MaxLocks = (); type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = (); } @@ -334,12 +312,10 @@ impl pallet_assets::Config for Runtime { type ApprovalDeposit = ApprovalDeposit; type StringLimit = AssetsStringLimit; type Freezer = (); - type Extra = (); type CreateOrigin = AsEnsureOriginWithArg>; type WeightInfo = pallet_assets::weights::SubstrateWeight; type RemoveItemsLimit = ConstU32<0>; type AssetIdParameter = AssetId; - type CallbackHandle = (); #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); } diff --git a/tests/xcm-simulator/src/mocks/parachain.rs b/tests/xcm-simulator/src/mocks/parachain.rs index a944e7f81b..a91f46316d 100644 --- a/tests/xcm-simulator/src/mocks/parachain.rs +++ b/tests/xcm-simulator/src/mocks/parachain.rs @@ -92,25 +92,9 @@ impl frame_system::Config for Runtime { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type BlockWeights = (); - type BlockLength = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type DbWeight = (); - type BaseCallFilter = Everything; - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } parameter_types! { @@ -124,10 +108,8 @@ impl pallet_balances::Config for Runtime { type MaxLocks = MaxLocks; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = RuntimeHoldReason; @@ -159,9 +141,7 @@ impl pallet_assets::Config for Runtime { type ApprovalDeposit = ConstU128<10>; type StringLimit = ConstU32<50>; type Freezer = (); - type Extra = (); type RemoveItemsLimit = ConstU32<100>; - type CallbackHandle = (); type WeightInfo = pallet_assets::weights::SubstrateWeight; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); @@ -169,10 +149,7 @@ impl pallet_assets::Config for Runtime { #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime { - type Moment = u64; - type OnTimestampSet = (); type MinimumPeriod = ConstU64<1>; - type WeightInfo = (); } impl pallet_insecure_randomness_collective_flip::Config for Runtime {} @@ -265,7 +242,6 @@ impl pallet_contracts::Config for Runtime { /// We are not using the pallet_transaction_payment for simplicity type WeightPrice = Self; type WeightInfo = pallet_contracts::weights::SubstrateWeight; - type ChainExtension = (); type Schedule = Schedule; type AddressGenerator = pallet_contracts::DefaultAddressGenerator; type MaxCodeLen = ConstU32<{ 123 * 1024 }>; @@ -274,13 +250,8 @@ impl pallet_contracts::Config for Runtime { type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; type MaxDelegateDependencies = MaxDelegateDependencies; - type Migrations = (); - type Debug = (); - type Environment = (); - type Xcm = (); type UploadOrigin = EnsureSigned; type InstantiateOrigin = EnsureSigned; - type ApiVersion = (); type MaxTransientStorageSize = ConstU32<{ 1 * 1024 * 1024 }>; } diff --git a/tests/xcm-simulator/src/mocks/relay_chain.rs b/tests/xcm-simulator/src/mocks/relay_chain.rs index cd893b1963..5522abaca9 100644 --- a/tests/xcm-simulator/src/mocks/relay_chain.rs +++ b/tests/xcm-simulator/src/mocks/relay_chain.rs @@ -59,25 +59,9 @@ impl frame_system::Config for Runtime { type Lookup = IdentityLookup; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; - type BlockWeights = (); - type BlockLength = (); - type Version = (); type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type DbWeight = (); - type BaseCallFilter = Everything; - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = RuntimeTask; - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); } parameter_types! { @@ -91,15 +75,12 @@ impl pallet_balances::Config for Runtime { type MaxLocks = MaxLocks; type Balance = Balance; type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = (); type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type RuntimeFreezeReason = (); type MaxFreezes = ConstU32<0>; } From 039cd439354551f7ef130703d05092182e0c352e Mon Sep 17 00:00:00 2001 From: Anton Gavrilov Date: Thu, 23 Jan 2025 11:18:26 +0100 Subject: [PATCH 3/3] Further cleanup of default parameters --- chain-extensions/pallet-assets/src/mock.rs | 37 ++------------------ pallets/astar-xcm-benchmarks/src/mock.rs | 26 ++------------ pallets/collator-selection/src/mock.rs | 27 ++------------ pallets/collective-proxy/src/mock.rs | 27 ++------------ pallets/dapp-staking/src/test/mock.rs | 22 +----------- pallets/dynamic-evm-base-fee/src/mock.rs | 29 ++------------- pallets/ethereum-checked/src/mock.rs | 16 --------- pallets/inflation/src/mock.rs | 27 ++------------ pallets/price-aggregator/src/mock.rs | 26 +------------- pallets/static-price-provider/src/mock.rs | 29 ++------------- pallets/unified-accounts/src/mock.rs | 18 +--------- pallets/xc-asset-config/src/mock.rs | 28 ++------------- precompiles/assets-erc20/src/mock.rs | 28 ++------------- precompiles/dapp-staking/src/test/mock.rs | 18 ++-------- precompiles/dispatch-lockdrop/src/mock.rs | 19 ++-------- precompiles/sr25519/src/mock.rs | 25 ++----------- precompiles/substrate-ecdsa/src/mock.rs | 26 ++------------ precompiles/unified-accounts/src/mock.rs | 17 +-------- precompiles/xcm/src/mock.rs | 25 ++----------- tests/xcm-simulator/src/mocks/parachain.rs | 30 ---------------- tests/xcm-simulator/src/mocks/relay_chain.rs | 17 --------- 21 files changed, 37 insertions(+), 480 deletions(-) diff --git a/chain-extensions/pallet-assets/src/mock.rs b/chain-extensions/pallet-assets/src/mock.rs index ae6504e371..57add996b3 100644 --- a/chain-extensions/pallet-assets/src/mock.rs +++ b/chain-extensions/pallet-assets/src/mock.rs @@ -20,16 +20,16 @@ use crate::AssetsExtension; use frame_support::traits::{AsEnsureOriginWithArg, ConstU128, Currency, Randomness}; use frame_support::{ derive_impl, parameter_types, - traits::{ConstU32, ConstU64, Nothing}, + traits::{ConstU64, Nothing}, weights::Weight, }; use frame_system::EnsureSigned; use pallet_contracts::chain_extension::RegisteredChainExtension; -use pallet_contracts::{Config, DefaultAddressGenerator, Frame}; +use pallet_contracts::{Config, Frame}; use sp_core::crypto::AccountId32; use sp_runtime::{ testing::H256, - traits::{BlakeTwo256, Convert, IdentityLookup, Zero}, + traits::{Convert, IdentityLookup, Zero}, BuildStorage, Perbill, }; @@ -49,19 +49,10 @@ parameter_types! { } #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type BlockWeights = BlockWeights; - type RuntimeOrigin = RuntimeOrigin; type Block = Block; - type Hash = H256; - type RuntimeCall = RuntimeCall; - type Hashing = BlakeTwo256; type AccountId = AccountId32; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } parameter_types! { @@ -90,23 +81,12 @@ impl pallet_contracts::Config for Test { type RuntimeCall = RuntimeCall; type CallFilter = Nothing; type CallStack = [Frame; 5]; - type WeightPrice = Self; type ChainExtension = AssetsExtension; type Schedule = Schedule; - type DepositPerByte = DepositPerByte; - type DepositPerItem = DepositPerItem; - type DefaultDepositLimit = DefaultDepositLimit; - type AddressGenerator = DefaultAddressGenerator; - type MaxCodeLen = ConstU32<{ 123 * 1024 }>; - type MaxStorageKeyLen = ConstU32<128>; type UnsafeUnstableInterface = UnstableInterface; - type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; - type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; - type MaxDelegateDependencies = MaxDelegateDependencies; type RuntimeHoldReason = RuntimeHoldReason; type UploadOrigin = EnsureSigned; type InstantiateOrigin = EnsureSigned; - type MaxTransientStorageSize = ConstU32<{ 1 * 1024 * 1024 }>; } impl RegisteredChainExtension for AssetsExtension { @@ -119,16 +99,9 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type MaxLocks = (); - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] @@ -150,11 +123,7 @@ impl pallet_assets::Config for Test { type MetadataDepositBase = ConstU128<1>; type MetadataDepositPerByte = ConstU128<1>; type ApprovalDeposit = ConstU128<1>; - type StringLimit = ConstU32<50>; type Freezer = (); - type RemoveItemsLimit = ConstU32<5>; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = (); } type Block = frame_system::mocking::MockBlockU32; diff --git a/pallets/astar-xcm-benchmarks/src/mock.rs b/pallets/astar-xcm-benchmarks/src/mock.rs index 462ac400cb..47ddd172ae 100644 --- a/pallets/astar-xcm-benchmarks/src/mock.rs +++ b/pallets/astar-xcm-benchmarks/src/mock.rs @@ -29,8 +29,8 @@ use frame_support::{ use frame_system::{EnsureRoot, EnsureSigned}; use core::marker::PhantomData; -use sp_core::{ConstU32, ConstU64, Get, H256}; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; +use sp_core::{ConstU64, Get}; +use sp_runtime::traits::IdentityLookup; use xcm::latest::prelude::*; use xcm_builder::{AllowUnpaidExecutionFrom, FungiblesAdapter, MintLocation, NoChecking}; @@ -107,19 +107,9 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { type Block = Block; - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type Hash = H256; - type RuntimeCall = RuntimeCall; - type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type MaxConsumers = ConstU32<16>; - type RuntimeTask = RuntimeTask; } parameter_types! { @@ -128,16 +118,8 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type MaxLocks = (); - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; - type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } #[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)] @@ -154,11 +136,7 @@ impl pallet_assets::Config for Test { type MetadataDepositPerByte = ConstU64<1>; type AssetAccountDeposit = ConstU64<10>; type ApprovalDeposit = ConstU64<10>; - type StringLimit = ConstU32<50>; type Freezer = (); - type RemoveItemsLimit = ConstU32<100>; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = (); } pub struct MatchOnlyAsset(PhantomData); diff --git a/pallets/collator-selection/src/mock.rs b/pallets/collator-selection/src/mock.rs index f1a1082072..a2cdee9de3 100644 --- a/pallets/collator-selection/src/mock.rs +++ b/pallets/collator-selection/src/mock.rs @@ -19,16 +19,14 @@ use super::*; use crate as collator_selection; use frame_support::{ derive_impl, ord_parameter_types, parameter_types, - traits::{ConstU32, FindAuthor, ValidatorRegistration}, + traits::{FindAuthor, ValidatorRegistration}, PalletId, }; use frame_system as system; use frame_system::EnsureSignedBy; -use sp_core::{ConstBool, H256}; +use sp_core::ConstBool; use sp_runtime::{ - testing::UintAuthorityId, - traits::{BlakeTwo256, IdentityLookup, OpaqueKeys}, - BuildStorage, Perbill, RuntimeAppPublic, + testing::UintAuthorityId, traits::OpaqueKeys, BuildStorage, Perbill, RuntimeAppPublic, }; type Block = frame_system::mocking::MockBlock; @@ -53,20 +51,8 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl system::Config for Test { - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type SS58Prefix = SS58Prefix; - type RuntimeTask = RuntimeTask; } parameter_types! { @@ -76,15 +62,8 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type MaxLocks = (); - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 8]; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } pub struct Author4; diff --git a/pallets/collective-proxy/src/mock.rs b/pallets/collective-proxy/src/mock.rs index 7164cb3c60..2929718705 100644 --- a/pallets/collective-proxy/src/mock.rs +++ b/pallets/collective-proxy/src/mock.rs @@ -21,15 +21,11 @@ use crate::{self as pallet_collective_proxy}; use astar_primitives::{Balance, BlockNumber}; use frame_support::{ construct_runtime, derive_impl, ord_parameter_types, parameter_types, - traits::{ConstU128, ConstU32, InstanceFilter}, + traits::{ConstU128, InstanceFilter}, weights::Weight, }; -use sp_core::H256; use sp_io::TestExternalities; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; +use sp_runtime::BuildStorage; use frame_system::EnsureSignedBy; @@ -55,34 +51,15 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type MaxLocks = ConstU32<4>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU128<1>; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = RuntimeFreezeReason; - type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxFreezes = ConstU32<1>; } parameter_types! { diff --git a/pallets/dapp-staking/src/test/mock.rs b/pallets/dapp-staking/src/test/mock.rs index 0dc4f6400e..aa555bf90f 100644 --- a/pallets/dapp-staking/src/test/mock.rs +++ b/pallets/dapp-staking/src/test/mock.rs @@ -30,12 +30,8 @@ use frame_support::{ weights::Weight, }; use sp_arithmetic::fixed_point::FixedU128; -use sp_core::H256; use sp_io::TestExternalities; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, Permill, -}; +use sp_runtime::{BuildStorage, Permill}; use sp_std::cell::RefCell; use astar_primitives::{ @@ -68,32 +64,16 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; type MultiBlockMigrator = MultiBlockMigrations; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type MaxLocks = ConstU32<4>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU128; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = RuntimeFreezeReason; type RuntimeFreezeReason = RuntimeFreezeReason; type MaxFreezes = ConstU32<1>; diff --git a/pallets/dynamic-evm-base-fee/src/mock.rs b/pallets/dynamic-evm-base-fee/src/mock.rs index 91065eecde..b41626903b 100644 --- a/pallets/dynamic-evm-base-fee/src/mock.rs +++ b/pallets/dynamic-evm-base-fee/src/mock.rs @@ -23,18 +23,12 @@ use crate as pallet_dynamic_evm_base_fee; use frame_support::{ construct_runtime, derive_impl, parameter_types, storage, - traits::{ConstU128, ConstU32, ConstU64, Get}, - weights::constants::RocksDbWeight, + traits::{ConstU128, ConstU64, Get}, }; use parity_scale_codec::Encode; -use sp_core::H256; use sp_io::TestExternalities; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup, One}, - BuildStorage, FixedU128, Perquintill, -}; +use sp_runtime::{traits::One, BuildStorage, FixedU128, Perquintill}; -pub(crate) type AccountId = u128; pub(crate) type Balance = u128; parameter_types! { @@ -44,34 +38,15 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = ConstU32<250>; - type DbWeight = RocksDbWeight; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { - type MaxLocks = ConstU32<4>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU128<2>; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] diff --git a/pallets/ethereum-checked/src/mock.rs b/pallets/ethereum-checked/src/mock.rs index b5dd744c73..949517244e 100644 --- a/pallets/ethereum-checked/src/mock.rs +++ b/pallets/ethereum-checked/src/mock.rs @@ -43,33 +43,17 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = ConstU64<250>; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { - type MaxLocks = ConstU32<4>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU128<2>; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] diff --git a/pallets/inflation/src/mock.rs b/pallets/inflation/src/mock.rs index f6b210e624..bd95e1a76c 100644 --- a/pallets/inflation/src/mock.rs +++ b/pallets/inflation/src/mock.rs @@ -23,19 +23,14 @@ use crate::{ use frame_support::{ construct_runtime, derive_impl, parameter_types, - traits::{fungible::Balanced, ConstU128, ConstU32, Hooks}, + traits::{fungible::Balanced, ConstU128, Hooks}, weights::Weight, PalletId, }; -use sp_core::H256; use sp_io::TestExternalities; -use sp_runtime::{ - traits::{AccountIdConversion, BlakeTwo256, IdentityLookup}, - BuildStorage, Perquintill, -}; +use sp_runtime::{traits::AccountIdConversion, BuildStorage, Perquintill}; use astar_primitives::{Balance, BlockNumber}; -pub(crate) type AccountId = u64; /// Initial inflation params set by the mock. pub const INIT_PARAMS: InflationParameters = InflationParameters { @@ -59,33 +54,15 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type MaxLocks = ConstU32<4>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU128<1>; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } // Dummy accounts used to simulate reward beneficiaries balances pub(crate) const TREASURY_POT: PalletId = PalletId(*b"moktrsry"); diff --git a/pallets/price-aggregator/src/mock.rs b/pallets/price-aggregator/src/mock.rs index 67eb78d097..c3d2d7a1b4 100644 --- a/pallets/price-aggregator/src/mock.rs +++ b/pallets/price-aggregator/src/mock.rs @@ -25,15 +25,10 @@ use frame_support::{ traits::{ConstU128, ConstU32, Hooks}, weights::Weight, }; -use sp_core::H256; use sp_io::TestExternalities; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; +use sp_runtime::BuildStorage; use astar_primitives::{oracle::CurrencyId, Balance, BlockNumber}; -type AccountId = u64; type Block = frame_system::mocking::MockBlockU32; @@ -45,34 +40,15 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type MaxLocks = ConstU32<4>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU128<1>; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxFreezes = ConstU32<0>; } parameter_types! { diff --git a/pallets/static-price-provider/src/mock.rs b/pallets/static-price-provider/src/mock.rs index f33ed155dd..1af5c0a2a6 100644 --- a/pallets/static-price-provider/src/mock.rs +++ b/pallets/static-price-provider/src/mock.rs @@ -19,19 +19,12 @@ use crate::{self as pallet_static_price_provider}; use frame_support::{ - construct_runtime, derive_impl, parameter_types, - traits::{ConstU128, ConstU32}, - weights::Weight, + construct_runtime, derive_impl, parameter_types, traits::ConstU128, weights::Weight, }; -use sp_core::H256; use sp_io::TestExternalities; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; +use sp_runtime::BuildStorage; use astar_primitives::{Balance, BlockNumber}; -type AccountId = u64; type Block = frame_system::mocking::MockBlock; @@ -43,33 +36,15 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type MaxLocks = ConstU32<4>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU128<1>; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } impl pallet_static_price_provider::Config for Test { diff --git a/pallets/unified-accounts/src/mock.rs b/pallets/unified-accounts/src/mock.rs index 93113e4ffd..6843592870 100644 --- a/pallets/unified-accounts/src/mock.rs +++ b/pallets/unified-accounts/src/mock.rs @@ -28,7 +28,7 @@ use frame_support::{ }; use pallet_ethereum::PostLogContent; use pallet_evm::FeeCalculator; -use sp_core::{keccak_256, H160, H256, U256}; +use sp_core::{keccak_256, H160, U256}; use sp_io::TestExternalities; use sp_runtime::{ traits::{AccountIdLookup, BlakeTwo256}, @@ -43,34 +43,18 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = (AccountIdLookup, UnifiedAccounts); - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = ConstU64<250>; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; type OnKilledAccount = KillAccountMapping; - type RuntimeTask = RuntimeTask; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { - type MaxLocks = ConstU32<4>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] diff --git a/pallets/xc-asset-config/src/mock.rs b/pallets/xc-asset-config/src/mock.rs index 6247c0ae82..1201345003 100644 --- a/pallets/xc-asset-config/src/mock.rs +++ b/pallets/xc-asset-config/src/mock.rs @@ -18,16 +18,10 @@ use crate::{self as pallet_xc_asset_config}; -use frame_support::{ - construct_runtime, derive_impl, parameter_types, traits::ConstU32, weights::Weight, -}; -use sp_core::H256; +use frame_support::{construct_runtime, derive_impl, parameter_types, weights::Weight}; use sp_io::TestExternalities; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; +use sp_runtime::BuildStorage; type Balance = u128; type AccountId = u64; @@ -52,19 +46,8 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } parameter_types! { @@ -74,16 +57,9 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type MaxLocks = MaxLocks; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } type AssetId = u128; diff --git a/precompiles/assets-erc20/src/mock.rs b/precompiles/assets-erc20/src/mock.rs index ff894a7ad6..ce110f3f6f 100644 --- a/precompiles/assets-erc20/src/mock.rs +++ b/precompiles/assets-erc20/src/mock.rs @@ -39,7 +39,7 @@ use super::*; use frame_support::{ construct_runtime, derive_impl, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU64, Everything}, + traits::{AsEnsureOriginWithArg, ConstU64}, weights::Weight, }; @@ -50,11 +50,8 @@ use precompile_utils::{ testing::{AddressInPrefixedSet, MockAccount}, }; -use sp_core::{ConstU32, H160, H256}; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; +use sp_core::{ConstU32, H160}; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; pub type AccountId = MockAccount; pub type AssetId = u128; @@ -94,20 +91,10 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; type Block = Block; - type RuntimeCall = RuntimeCall; - type Hash = H256; - type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type SS58Prefix = SS58Prefix; - type RuntimeTask = RuntimeTask; } parameter_types! { @@ -125,16 +112,9 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { - type MaxReserves = (); - type ReserveIdentifier = (); - type MaxLocks = (); type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type RuntimeHoldReason = (); - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } parameter_types! { @@ -198,8 +178,6 @@ impl pallet_assets::Config for Runtime { type WeightInfo = pallet_assets::weights::SubstrateWeight; type RemoveItemsLimit = ConstU32<0>; type AssetIdParameter = AssetId; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = (); } // Configure a mock runtime to test the pallet. diff --git a/precompiles/dapp-staking/src/test/mock.rs b/precompiles/dapp-staking/src/test/mock.rs index 62eb9d5c08..1d40672852 100644 --- a/precompiles/dapp-staking/src/test/mock.rs +++ b/precompiles/dapp-staking/src/test/mock.rs @@ -32,10 +32,10 @@ use pallet_evm::{ AddressMapping, EnsureAddressNever, EnsureAddressRoot, PrecompileResult, PrecompileSet, }; use sp_arithmetic::{fixed_point::FixedU128, Permill}; -use sp_core::{H160, H256}; +use sp_core::H160; use sp_io::TestExternalities; use sp_runtime::{ - traits::{BlakeTwo256, ConstU32, IdentityLookup}, + traits::{ConstU32, IdentityLookup}, BuildStorage, Perbill, }; extern crate alloc; @@ -79,31 +79,17 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Test { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; - type Hash = H256; type Block = Block; - type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Test { - type MaxLocks = ConstU32<4>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ConstU128<1>; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = RuntimeFreezeReason; type RuntimeFreezeReason = RuntimeFreezeReason; type MaxFreezes = ConstU32<1>; diff --git a/precompiles/dispatch-lockdrop/src/mock.rs b/precompiles/dispatch-lockdrop/src/mock.rs index cb0a9d3b7f..94be57109b 100644 --- a/precompiles/dispatch-lockdrop/src/mock.rs +++ b/precompiles/dispatch-lockdrop/src/mock.rs @@ -26,9 +26,9 @@ use frame_support::{ pub use pallet_evm::{ AddressMapping, EnsureAddressNever, EnsureAddressRoot, PrecompileResult, PrecompileSet, }; -use sp_core::{keccak_256, H160, H256}; +use sp_core::{keccak_256, H160}; use sp_runtime::{ - traits::{BlakeTwo256, ConstU32, IdentityLookup}, + traits::{ConstU32, IdentityLookup}, AccountId32, }; @@ -56,19 +56,10 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; type AccountId = AccountId32; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } pub struct WhitelistedCalls; @@ -116,15 +107,9 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { - type MaxReserves = (); - type MaxLocks = (); type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } parameter_types! { diff --git a/precompiles/sr25519/src/mock.rs b/precompiles/sr25519/src/mock.rs index 47d2c4f3f4..61ba4e75f8 100644 --- a/precompiles/sr25519/src/mock.rs +++ b/precompiles/sr25519/src/mock.rs @@ -23,7 +23,7 @@ use super::*; use fp_evm::{IsPrecompileResult, Precompile}; use frame_support::{ construct_runtime, derive_impl, parameter_types, - traits::{ConstU32, ConstU64, Everything}, + traits::{ConstU32, ConstU64}, weights::Weight, }; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; @@ -33,11 +33,8 @@ use serde::{Deserialize, Serialize}; use pallet_evm::{ AddressMapping, EnsureAddressNever, EnsureAddressRoot, PrecompileResult, PrecompileSet, }; -use sp_core::{H160, H256}; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; +use sp_core::H160; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; pub type AccountId = TestAccount; pub type Balance = u128; @@ -111,20 +108,10 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; type Block = Block; - type RuntimeCall = RuntimeCall; - type Hash = H256; - type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type SS58Prefix = SS58Prefix; - type RuntimeTask = RuntimeTask; } #[derive(Debug, Clone, Copy)] @@ -165,15 +152,9 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { - type MaxReserves = (); - type MaxLocks = (); type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } parameter_types! { diff --git a/precompiles/substrate-ecdsa/src/mock.rs b/precompiles/substrate-ecdsa/src/mock.rs index b2c6cb7571..f247b8bd42 100644 --- a/precompiles/substrate-ecdsa/src/mock.rs +++ b/precompiles/substrate-ecdsa/src/mock.rs @@ -23,7 +23,7 @@ use super::*; use fp_evm::{IsPrecompileResult, Precompile}; use frame_support::{ construct_runtime, derive_impl, parameter_types, - traits::{ConstU32, ConstU64, Everything}, + traits::{ConstU32, ConstU64}, weights::Weight, }; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; @@ -33,11 +33,8 @@ use serde::{Deserialize, Serialize}; use pallet_evm::{ AddressMapping, EnsureAddressNever, EnsureAddressRoot, PrecompileResult, PrecompileSet, }; -use sp_core::{H160, H256}; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; +use sp_core::H160; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; pub type AccountId = TestAccount; pub type Balance = u128; @@ -111,20 +108,10 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; type Block = Block; - type RuntimeCall = RuntimeCall; - type Hash = H256; - type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type SS58Prefix = SS58Prefix; - type RuntimeTask = RuntimeTask; } #[derive(Debug, Clone, Copy)] @@ -165,16 +152,9 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { - type MaxReserves = (); - type ReserveIdentifier = (); - type MaxLocks = (); type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } parameter_types! { diff --git a/precompiles/unified-accounts/src/mock.rs b/precompiles/unified-accounts/src/mock.rs index 82f82d010e..543d77d588 100644 --- a/precompiles/unified-accounts/src/mock.rs +++ b/precompiles/unified-accounts/src/mock.rs @@ -26,7 +26,7 @@ pub use pallet_evm::{EnsureAddressNever, EnsureAddressRoot, PrecompileResult, Pr use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; -use sp_core::{keccak_256, H160, H256}; +use sp_core::{keccak_256, H160}; use sp_runtime::{ traits::{BlakeTwo256, ConstU32, IdentityLookup}, AccountId32, BuildStorage, @@ -116,19 +116,10 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for TestRuntime { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; type Block = Block; - type Hash = H256; - type Hashing = BlakeTwo256; type AccountId = AccountId32; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } #[derive(Debug, Clone, Copy)] pub struct TestPrecompileSet(PhantomData); @@ -162,15 +153,9 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for TestRuntime { - type MaxReserves = (); - type MaxLocks = (); type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } parameter_types! { diff --git a/precompiles/xcm/src/mock.rs b/precompiles/xcm/src/mock.rs index beea54d8df..41a937b43b 100644 --- a/precompiles/xcm/src/mock.rs +++ b/precompiles/xcm/src/mock.rs @@ -35,11 +35,8 @@ use pallet_evm::{ AddressMapping, EnsureAddressNever, EnsureAddressRoot, PrecompileResult, PrecompileSet, }; use pallet_evm_precompile_assets_erc20::AddressToAssetId; -use sp_core::{ConstU32, H160, H256}; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; +use sp_core::{ConstU32, H160}; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; use sp_std::cell::RefCell; use astar_primitives::xcm::AllowTopLevelPaidExecutionFrom; @@ -217,20 +214,10 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; type Block = Block; - type RuntimeCall = RuntimeCall; - type Hash = H256; - type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type SS58Prefix = SS58Prefix; - type RuntimeTask = RuntimeTask; } #[derive(Debug, Clone, Copy)] @@ -276,15 +263,9 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { - type MaxReserves = (); - type MaxLocks = (); type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = (); } // These parameters dont matter much as this will only be called by root with the forced arguments @@ -316,8 +297,6 @@ impl pallet_assets::Config for Runtime { type WeightInfo = pallet_assets::weights::SubstrateWeight; type RemoveItemsLimit = ConstU32<0>; type AssetIdParameter = AssetId; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = (); } pub struct AssetIdConverter(PhantomData); diff --git a/tests/xcm-simulator/src/mocks/parachain.rs b/tests/xcm-simulator/src/mocks/parachain.rs index a91f46316d..a5a43a01dc 100644 --- a/tests/xcm-simulator/src/mocks/parachain.rs +++ b/tests/xcm-simulator/src/mocks/parachain.rs @@ -37,7 +37,6 @@ use frame_system::{ EnsureRoot, EnsureSigned, }; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; -use sp_core::H256; use sp_runtime::{ traits::{AccountIdConversion, Convert, Get, IdentityLookup, MaybeEquivalence}, AccountId32, FixedU128, Perbill, RuntimeDebug, @@ -82,19 +81,10 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; type Block = Block; - type Hash = H256; - type Hashing = sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } parameter_types! { @@ -105,14 +95,9 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 8]; - type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = RuntimeFreezeReason; type MaxFreezes = ConstU32<1>; @@ -139,12 +124,9 @@ impl pallet_assets::Config for Runtime { type MetadataDepositPerByte = ConstU128<1>; type AssetAccountDeposit = ConstU128<10>; type ApprovalDeposit = ConstU128<10>; - type StringLimit = ConstU32<50>; type Freezer = (); type RemoveItemsLimit = ConstU32<100>; type WeightInfo = pallet_assets::weights::SubstrateWeight; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = (); } #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] @@ -235,24 +217,12 @@ impl pallet_contracts::Config for Runtime { /// change because that would break already deployed contracts. The `Call` structure itself /// is not allowed to change the indices of existing pallets, too. type CallFilter = CallFilter; - type DepositPerItem = DepositPerItem; - type DepositPerByte = DepositPerByte; - type DefaultDepositLimit = DefaultDepositLimit; type CallStack = [pallet_contracts::Frame; 5]; /// We are not using the pallet_transaction_payment for simplicity - type WeightPrice = Self; type WeightInfo = pallet_contracts::weights::SubstrateWeight; type Schedule = Schedule; - type AddressGenerator = pallet_contracts::DefaultAddressGenerator; - type MaxCodeLen = ConstU32<{ 123 * 1024 }>; - type MaxStorageKeyLen = ConstU32<128>; - type UnsafeUnstableInterface = ConstBool; - type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; - type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; - type MaxDelegateDependencies = MaxDelegateDependencies; type UploadOrigin = EnsureSigned; type InstantiateOrigin = EnsureSigned; - type MaxTransientStorageSize = ConstU32<{ 1 * 1024 * 1024 }>; } /// The type used to represent the kinds of proxying allowed. diff --git a/tests/xcm-simulator/src/mocks/relay_chain.rs b/tests/xcm-simulator/src/mocks/relay_chain.rs index 5522abaca9..682737ad26 100644 --- a/tests/xcm-simulator/src/mocks/relay_chain.rs +++ b/tests/xcm-simulator/src/mocks/relay_chain.rs @@ -22,7 +22,6 @@ use frame_support::{ weights::{Weight, WeightMeter}, }; use frame_system::EnsureRoot; -use sp_core::H256; use sp_runtime::{traits::IdentityLookup, AccountId32}; use polkadot_parachain::primitives::Id as ParaId; @@ -49,19 +48,10 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig)] impl frame_system::Config for Runtime { - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; type Block = Block; - type Hash = H256; - type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; - type RuntimeTask = RuntimeTask; } parameter_types! { @@ -72,16 +62,9 @@ parameter_types! { #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; type Balance = Balance; - type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 8]; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; } impl shared::Config for Runtime {