From 6c86c525a9fe79cab9086dd95cf0a93e29c893c0 Mon Sep 17 00:00:00 2001 From: Doordashcon Date: Mon, 15 Sep 2025 09:33:06 +0100 Subject: [PATCH] Simulate `rank_to_votes` in `pallet-ranked-collective` benchmark. (#9731) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolves #9730 --------- Co-authored-by: Bastian Köcher Co-authored-by: Oliver Tale-Yazdi (cherry picked from commit 1cbf4eed97a87ae4c1aef6176c80761c49f60e6f) --- prdoc/pr_9731.prdoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 prdoc/pr_9731.prdoc diff --git a/prdoc/pr_9731.prdoc b/prdoc/pr_9731.prdoc new file mode 100644 index 0000000000000..5ce5576d95fcc --- /dev/null +++ b/prdoc/pr_9731.prdoc @@ -0,0 +1,14 @@ +title: simulate `rank_to_votes` conversion in vote benchmark + +doc: +- audience: Runtime Dev + description: | + Fixes benchmarking failures for the vote extrinsic in pallet-ranked-collective by properly + simulating the `rank_to_votes` conversion process. Previously used hardcoded vote values + which caused assertion failures when using custom VoteWeight converters (e.g., in + [Ambassador Collective configuration](https://github.com/polkadot-fellows/runtimes/pull/736)). The fix calculates vote weight based on member's + actual rank and minimum required rank for the class. + +crates: +- name: pallet-ranked-collective + bump: patch \ No newline at end of file