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

fix sibmit benchmark in election-multi-phase pallet #11057

Merged
merged 1 commit into from
Mar 17, 2022
Merged
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
7 changes: 5 additions & 2 deletions frame/election-provider-multi-phase/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ frame_benchmarking::benchmarks! {
}

submit {

// the solution will be worse than all of them meaning the score need to be checked against
// ~ log2(c)
let solution = RawSolution {
Expand Down Expand Up @@ -341,7 +340,11 @@ frame_benchmarking::benchmarks! {
signed_submissions.put();

let caller = frame_benchmarking::whitelisted_caller();
T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance() * 10u32.into());
let deposit = MultiPhase::<T>::deposit_for(
&solution,
MultiPhase::<T>::snapshot_metadata().unwrap_or_default(),
);
T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance() * 1000u32.into() + deposit);

}: _(RawOrigin::Signed(caller), Box::new(solution))
verify {
Expand Down