Skip to content
Snippets Groups Projects
Unverified Commit 3dcd7d56 authored by thiolliere's avatar thiolliere Committed by thiolliere
Browse files

Fix staking benchmark (#6463)

Found by @ggwpez



Fix staking benchmark, error was introduced when migrating to v2:
https://github.com/paritytech/polkadot-sdk/pull/6025

---------

Co-authored-by: default avatarGitHub Action <action@github.com>
(cherry picked from commit a1af8ed6)
parent 65ee8088
No related merge requests found
title: Fix staking benchmark
doc:
- audience: Runtime Dev
description: 'Fix staking benchmark, error was introduced when migrating to v2:
https://github.com/paritytech/polkadot-sdk/pull/6025'
crates:
- name: pallet-staking
bump: patch
......@@ -975,20 +975,22 @@ mod benchmarks {
) -> Result<(), BenchmarkError> {
// number of nominator intention.
let n = MaxNominators::<T>::get();
create_validators_with_nominators_for_era::<T>(
v,
n,
MaxNominationsOf::<T>::get() as usize,
false,
None,
)?;
let targets;
#[block]
{
create_validators_with_nominators_for_era::<T>(
v,
n,
MaxNominationsOf::<T>::get() as usize,
false,
None,
)?;
// default bounds are unbounded.
targets = <Staking<T>>::get_npos_targets(DataProviderBounds::default());
}
// default bounds are unbounded.
let targets = <Staking<T>>::get_npos_targets(DataProviderBounds::default());
assert_eq!(targets.len() as u32, v);
Ok(())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment