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

Commit

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

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Also fix communal

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez authored Mar 20, 2023
1 parent 5f6cc69 commit 9795fa3
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 9795fa3

Please sign in to comment.