Skip to content

Commit

Permalink
Hotfix NIS benchmark (paritytech#13651)
Browse files Browse the repository at this point in the history
* Hotfix NIS rounding error

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Also fix communal

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez authored and breathx committed Apr 22, 2023
1 parent 7d955a8 commit 9c88292
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frame/nis/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ benchmarks! {
Nis::<T>::place_bid(RawOrigin::Signed(caller.clone()).into(), bid, 1)?;
Nis::<T>::process_queues(Perquintill::one(), 1, 2, &mut WeightCounter::unlimited());
frame_system::Pallet::<T>::set_block_number(Receipts::<T>::get(0).unwrap().expiry);
// FIXME: Ensure that the pallet has enough funding. This should already be the case, but
// a rounding error can cause it to fail.
T::Currency::set_balance(&Nis::<T>::account_id(), BalanceOf::<T>::max_value() / 10u32.into());
}: _(RawOrigin::Signed(caller.clone()), 0, None)
verify {
assert!(Receipts::<T>::get(0).is_none());
Expand All @@ -182,6 +185,9 @@ benchmarks! {
Nis::<T>::process_queues(Perquintill::one(), 1, 2, &mut WeightCounter::unlimited());
frame_system::Pallet::<T>::set_block_number(Receipts::<T>::get(0).unwrap().expiry);
Nis::<T>::communify(RawOrigin::Signed(caller.clone()).into(), 0)?;
// FIXME: Ensure that the pallet has enough funding. This should already be the case, but
// a rounding error can cause it to fail.
T::Currency::set_balance(&Nis::<T>::account_id(), BalanceOf::<T>::max_value() / 10u32.into());
}: _(RawOrigin::Signed(caller.clone()), 0)
verify {
assert!(Receipts::<T>::get(0).is_none());
Expand Down

0 comments on commit 9c88292

Please sign in to comment.