Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Collective benchmark respects DefaultVote configuration (#12612)
Browse files Browse the repository at this point in the history
* Collective benchmark respects DefaultVote configuration

* ".git/.scripts/bench-bot.sh" pallet dev pallet_collective

Co-authored-by: command-bot <>
  • Loading branch information
muharem authored Nov 3, 2022
1 parent 265e3f1 commit a4ebc27
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 118 deletions.
10 changes: 10 additions & 0 deletions frame/collective/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,19 @@ benchmarks_instance_pallet! {
let index = p - 1;
// Have almost everyone vote aye on last proposal, while keeping it from passing.
// A few abstainers will be the nay votes needed to fail the vote.
let mut yes_votes: MemberCount = 0;
for j in 2 .. m - 1 {
let voter = &members[j as usize];
let approve = true;
yes_votes += 1;
// vote aye till a prime nay vote keeps the proposal disapproved.
if <<T as Config<I>>::DefaultVote as DefaultVote>::default_vote(
Some(false),
yes_votes,
0,
m,) {
break;
}
Collective::<T, I>::vote(
SystemOrigin::Signed(voter.clone()).into(),
last_hash,
Expand Down
Loading

0 comments on commit a4ebc27

Please sign in to comment.