@@ -177,6 +177,27 @@ parameter_types! {
177
177
pub MaxProposalWeight : Weight = sp_runtime:: Perbill :: from_percent( 50 ) * BlockWeights :: get( ) . max_block;
178
178
}
179
179
180
+ pub struct MemberProposals ;
181
+ impl pallet_collective:: CanPropose < u64 > for MemberProposals {
182
+ fn can_propose ( who : & u64 ) -> bool {
183
+ [ 1 , 2 , 3 ] . contains ( who)
184
+ }
185
+ }
186
+
187
+ pub struct MemberVotes ;
188
+ impl pallet_collective:: CanVote < u64 > for MemberVotes {
189
+ fn can_vote ( who : & u64 ) -> bool {
190
+ [ 1 , 2 , 3 ] . contains ( who)
191
+ }
192
+ }
193
+
194
+ pub struct StoredVotingMembers ;
195
+ impl pallet_collective:: GetVotingMembers < u32 > for StoredVotingMembers {
196
+ fn get_count ( ) -> u32 {
197
+ 3
198
+ }
199
+ }
200
+
180
201
type CouncilCollective = pallet_collective:: Instance1 ;
181
202
impl pallet_collective:: Config < CouncilCollective > for Test {
182
203
type RuntimeOrigin = RuntimeOrigin ;
@@ -188,9 +209,9 @@ impl pallet_collective::Config<CouncilCollective> for Test {
188
209
type DefaultVote = pallet_collective:: PrimeDefaultVote ;
189
210
type WeightInfo = ( ) ;
190
211
type SetMembersOrigin = frame_system:: EnsureRoot < Self :: AccountId > ;
191
- type CanPropose = ( ) ;
192
- type CanVote = ( ) ;
193
- type GetVotingMembers = ( ) ;
212
+ type CanPropose = MemberProposals ;
213
+ type CanVote = MemberVotes ;
214
+ type GetVotingMembers = StoredVotingMembers ;
194
215
}
195
216
196
217
impl example:: Config for Test { }
@@ -818,8 +839,9 @@ fn batch_works_with_council_origin() {
818
839
assert_ok ! ( Council :: vote( RuntimeOrigin :: signed( 3 ) , hash, 0 , true ) ) ;
819
840
820
841
System :: set_block_number ( 4 ) ;
842
+
821
843
assert_ok ! ( Council :: close(
822
- RuntimeOrigin :: signed ( 3 ) ,
844
+ RuntimeOrigin :: root ( ) ,
823
845
hash,
824
846
0 ,
825
847
proposal_weight,
@@ -856,7 +878,7 @@ fn force_batch_works_with_council_origin() {
856
878
857
879
System :: set_block_number ( 4 ) ;
858
880
assert_ok ! ( Council :: close(
859
- RuntimeOrigin :: signed ( 3 ) ,
881
+ RuntimeOrigin :: root ( ) ,
860
882
hash,
861
883
0 ,
862
884
proposal_weight,
0 commit comments