Replace parameter_types with ConstU32 &c. (#10402)

* remove parameter types and use const type

* remove parameter types and use const type

* Delete {

* Delete count,

* refractor for beefy, benchmarking, child bounties, and collective pallets

* refractor for pallet contracts

* refractor for elections

* refractor for more pallets

* fix CI issues

* fix CI issues

* fix CI issues

* fix CI issues

* remove warning to fix CI issue

* remove warning to fix CI issue
refractor for pallet preimage

* remove warning to fix CI issue
refractor for pallet proxy

* remove warning to fix CI issue
refractor for pallet recovery
refractor for pallet randomness-collective-flip

* remove warning to fix CI issue
refractor for pallet scored-pool
refractor for pallet scheduler
refractor for pallet session

* remove warning to fix CI issue
refractor for pallet society, support, system, timestamp, tips

* remove warning to fix CI issue
refractor for pallet transaction_payment, transaction_storage, treasury, uniques, utility

* remove warning to fix CI issue

* cargo +nightly fmt

* CI fix

* more param refractor on beefy-mmr

* refractor for beefy

* Update frame/babe/src/mock.rs

* Update frame/babe/src/mock.rs

* Update frame/bounties/src/tests.rs

* Update frame/tips/src/tests.rs

* Delete mock.rs

* Update frame/examples/basic/src/tests.rs

* Apply suggestions from code review

* Update frame/im-online/src/mock.rs

* Update frame/im-online/src/mock.rs

* Update frame/offences/benchmarking/src/mock.rs

* Update frame/session/benchmarking/src/mock.rs

* Update frame/support/test/tests/pallet_compatibility.rs

* Update frame/support/test/tests/pallet_compatibility_instance.rs

* Update frame/treasury/src/tests.rs

* Update test-utils/runtime/src/lib.rs

* some cleanup

* fmt

* remove unused

Co-authored-by: Damilare <dakinlose@teamapt.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
dharjeezy
2021-12-16 04:06:11 +01:00
committed by GitHub
parent cf1eb73046
commit 1b0be8ae06
76 changed files with 629 additions and 966 deletions
@@ -20,7 +20,7 @@ use frame_support::{
assert_ok,
pallet_prelude::*,
parameter_types,
traits::{fungibles::Mutate, FindAuthor},
traits::{fungibles::Mutate, ConstU32, ConstU64, ConstU8, FindAuthor},
weights::{
DispatchClass, DispatchInfo, PostDispatchInfo, Weight, WeightToFeeCoefficient,
WeightToFeeCoefficients, WeightToFeePolynomial,
@@ -83,7 +83,6 @@ impl Get<frame_system::limits::BlockWeights> for BlockWeights {
}
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub static TransactionByteFee: u64 = 1;
pub static WeightToFee: u64 = 1;
}
@@ -103,7 +102,7 @@ impl frame_system::Config for Runtime {
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = Event;
type BlockHashCount = BlockHashCount;
type BlockHashCount = ConstU64<250>;
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = pallet_balances::AccountData<u64>;
@@ -112,23 +111,22 @@ impl frame_system::Config for Runtime {
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
type MaxConsumers = ConstU32<16>;
}
parameter_types! {
pub const ExistentialDeposit: u64 = 10;
pub const MaxReserves: u32 = 50;
}
impl pallet_balances::Config for Runtime {
type Balance = Balance;
type Event = Event;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type ExistentialDeposit = ConstU64<10>;
type AccountStore = System;
type MaxLocks = ();
type WeightInfo = ();
type MaxReserves = MaxReserves;
type MaxReserves = ConstU32<50>;
type ReserveIdentifier = [u8; 8];
}
@@ -145,22 +143,12 @@ impl WeightToFeePolynomial for WeightToFee {
}
}
parameter_types! {
pub const OperationalFeeMultiplier: u8 = 5;
}
impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, ()>;
type TransactionByteFee = TransactionByteFee;
type WeightToFee = WeightToFee;
type FeeMultiplierUpdate = ();
type OperationalFeeMultiplier = OperationalFeeMultiplier;
}
parameter_types! {
pub const AssetDeposit: u64 = 2;
pub const MetadataDeposit: u64 = 0;
pub const StringLimit: u32 = 20;
type OperationalFeeMultiplier = ConstU8<5>;
}
impl pallet_assets::Config for Runtime {
@@ -169,12 +157,12 @@ impl pallet_assets::Config for Runtime {
type AssetId = u32;
type Currency = Balances;
type ForceOrigin = EnsureRoot<AccountId>;
type AssetDeposit = AssetDeposit;
type AssetAccountDeposit = frame_support::traits::ConstU64<2>;
type MetadataDepositBase = MetadataDeposit;
type MetadataDepositPerByte = MetadataDeposit;
type ApprovalDeposit = MetadataDeposit;
type StringLimit = StringLimit;
type AssetDeposit = ConstU64<2>;
type AssetAccountDeposit = ConstU64<2>;
type MetadataDepositBase = ConstU64<0>;
type MetadataDepositPerByte = ConstU64<0>;
type ApprovalDeposit = ConstU64<0>;
type StringLimit = ConstU32<20>;
type Freezer = ();
type Extra = ();
type WeightInfo = ();