Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
make benchmarks more or less work
  • Loading branch information
kianenigma committed Sep 30, 2022
commit ac2be3d34a8b5aa0d7d5d587d831acb69df242cf
15 changes: 7 additions & 8 deletions frame/fast-unstake/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ fn l<T: Config>(
}

fn create_unexposed_nominators<T: Config>() -> Vec<T::AccountId> {
(0..T::BatchSize::get()).map(|_| {
let account = frame_benchmarking::account::<T::AccountId>("nominator_42", 0, USER_SEED);
(0..T::BatchSize::get()).map(|i| {
let account = frame_benchmarking::account::<T::AccountId>("nominator_42", i, USER_SEED);
fund_and_bond_account::<T>(&account);
account
}).collect()
Expand Down Expand Up @@ -161,7 +161,7 @@ benchmarks! {
RawOrigin::Signed(s.clone()).into(),
));
(s, T::Deposit::get())
}).collect::<Vec<_>>().try_into().unwrap();
}).collect::<Vec<_>>();

// no one is queued thus far.
assert_eq!(Head::<T>::get(), None);
Expand All @@ -170,11 +170,10 @@ benchmarks! {
on_idle_full_block::<T>();
}
verify {
let checked: frame_support::BoundedVec<_, _> = (1..=u).rev().collect::<Vec<EraIndex>>().try_into().unwrap();
assert_eq!(
Head::<T>::get(),
Some(UnstakeRequest { stashes, checked })
);
let checked = (1..=u).rev().collect::<Vec<EraIndex>>();
let request = Head::<T>::get().unwrap();
assert_eq!(checked, request.checked.into_inner());
assert!(stashes.iter().all(|(s, _)| request.stashes.iter().find(|(ss, _)| ss == s).is_some()));
assert!(matches!(
fast_unstake_events::<T>().last(),
Some(Event::Checking { .. })
Expand Down