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

Move Staking Weights to T::WeightInfo #7007

Merged
22 commits merged into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions frame/session/benchmarking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use frame_system::RawOrigin;
use pallet_session::{historical::Module as Historical, Module as Session, *};
use pallet_staking::{
benchmarking::create_validator_with_nominators, testing_utils::create_validators,
MAX_NOMINATIONS,
MAX_NOMINATIONS, RewardDestination,
};
use sp_runtime::traits::{One, StaticLookup};

Expand All @@ -55,15 +55,20 @@ benchmarks! {

set_keys {
let n in 1 .. MAX_NOMINATIONS as u32;
let v_stash = create_validator_with_nominators::<T>(n, MAX_NOMINATIONS as u32, false)?;
let v_stash = create_validator_with_nominators::<T>(
n,
MAX_NOMINATIONS as u32,
false,
RewardDestination::Staked,
)?;
let v_controller = pallet_staking::Module::<T>::bonded(&v_stash).ok_or("not stash")?;
let keys = T::Keys::default();
let proof: Vec<u8> = vec![0,1,2,3];
}: _(RawOrigin::Signed(v_controller), keys, proof)

purge_keys {
let n in 1 .. MAX_NOMINATIONS as u32;
let v_stash = create_validator_with_nominators::<T>(n, MAX_NOMINATIONS as u32, false)?;
let v_stash = create_validator_with_nominators::<T>(n, MAX_NOMINATIONS as u32, false, RewardDestination::Staked)?;
let v_controller = pallet_staking::Module::<T>::bonded(&v_stash).ok_or("not stash")?;
let keys = T::Keys::default();
let proof: Vec<u8> = vec![0,1,2,3];
Expand Down
Loading