Companion PR: add weightinfo for collective (#1524)

* add and use generated weights for collective pallet

* correct pallet name

* MaxMembers

* add weight to technical collective

* Fix const assert

* update weights

* update import

* "Update Substrate"

* bump spec_version

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Alexander Popiak
2020-08-28 12:23:41 +02:00
committed by GitHub
parent 0931d0aafa
commit 6591b03480
7 changed files with 349 additions and 144 deletions
+9 -5
View File
@@ -87,7 +87,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 2023,
spec_version: 2024,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
@@ -407,6 +407,7 @@ impl pallet_democracy::Trait for Runtime {
parameter_types! {
pub const CouncilMotionDuration: BlockNumber = 3 * DAYS;
pub const CouncilMaxProposals: u32 = 100;
pub const CouncilMaxMembers: u32 = 100;
}
type CouncilCollective = pallet_collective::Instance1;
@@ -416,7 +417,8 @@ impl pallet_collective::Trait<CouncilCollective> for Runtime {
type Event = Event;
type MotionDuration = CouncilMotionDuration;
type MaxProposals = CouncilMaxProposals;
type WeightInfo = ();
type MaxMembers = CouncilMaxMembers;
type WeightInfo = weights::pallet_collective::WeightInfo;
}
parameter_types! {
@@ -428,8 +430,8 @@ parameter_types! {
pub const DesiredRunnersUp: u32 = 19;
pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect";
}
// Make sure that there are no more than MAX_MEMBERS members elected via phragmen.
const_assert!(DesiredMembers::get() <= pallet_collective::MAX_MEMBERS);
// Make sure that there are no more than MaxMembers members elected via phragmen.
const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get());
impl pallet_elections_phragmen::Trait for Runtime {
type Event = Event;
@@ -452,6 +454,7 @@ impl pallet_elections_phragmen::Trait for Runtime {
parameter_types! {
pub const TechnicalMotionDuration: BlockNumber = 3 * DAYS;
pub const TechnicalMaxProposals: u32 = 100;
pub const TechnicalMaxMembers: u32 = 100;
}
type TechnicalCollective = pallet_collective::Instance2;
@@ -461,7 +464,8 @@ impl pallet_collective::Trait<TechnicalCollective> for Runtime {
type Event = Event;
type MotionDuration = TechnicalMotionDuration;
type MaxProposals = TechnicalMaxProposals;
type WeightInfo = ();
type MaxMembers = TechnicalMaxMembers;
type WeightInfo = weights::pallet_collective::WeightInfo;
}
impl pallet_membership::Trait<pallet_membership::Instance1> for Runtime {