Collective pallet: max proposal weight (#13771)

* collective: max proposal weight

* fix test

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Muharem Ismailov
2023-04-19 13:00:27 +02:00
committed by GitHub
parent e458bf3795
commit f8b77f64f3
5 changed files with 66 additions and 2 deletions
+5 -1
View File
@@ -43,10 +43,12 @@ type AccountId = u64;
parameter_types! {
pub const BlockHashCount: BlockNumber = 250;
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::MAX);
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockWeights = BlockWeights;
type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
@@ -97,6 +99,7 @@ parameter_types! {
pub const MotionDuration: BlockNumber = MOTION_DURATION_IN_BLOCKS;
pub const MaxProposals: u32 = 100;
pub const MaxMembers: u32 = 100;
pub MaxProposalWeight: Weight = sp_runtime::Perbill::from_percent(50) * BlockWeights::get().max_block;
}
type AllianceCollective = pallet_collective::Instance1;
impl pallet_collective::Config<AllianceCollective> for Test {
@@ -109,6 +112,7 @@ impl pallet_collective::Config<AllianceCollective> for Test {
type DefaultVote = pallet_collective::PrimeDefaultVote;
type WeightInfo = ();
type SetMembersOrigin = EnsureRoot<Self::AccountId>;
type MaxProposalWeight = MaxProposalWeight;
}
parameter_types! {