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

Commit 9795fa3

Browse files
authored
Hotfix NIS benchmark (#13651)
* 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]>
1 parent 5f6cc69 commit 9795fa3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

frame/nis/src/benchmarking.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ benchmarks! {
164164
Nis::<T>::place_bid(RawOrigin::Signed(caller.clone()).into(), bid, 1)?;
165165
Nis::<T>::process_queues(Perquintill::one(), 1, 2, &mut WeightCounter::unlimited());
166166
frame_system::Pallet::<T>::set_block_number(Receipts::<T>::get(0).unwrap().expiry);
167+
// FIXME: Ensure that the pallet has enough funding. This should already be the case, but
168+
// a rounding error can cause it to fail.
169+
T::Currency::set_balance(&Nis::<T>::account_id(), BalanceOf::<T>::max_value() / 10u32.into());
167170
}: _(RawOrigin::Signed(caller.clone()), 0, None)
168171
verify {
169172
assert!(Receipts::<T>::get(0).is_none());
@@ -182,6 +185,9 @@ benchmarks! {
182185
Nis::<T>::process_queues(Perquintill::one(), 1, 2, &mut WeightCounter::unlimited());
183186
frame_system::Pallet::<T>::set_block_number(Receipts::<T>::get(0).unwrap().expiry);
184187
Nis::<T>::communify(RawOrigin::Signed(caller.clone()).into(), 0)?;
188+
// FIXME: Ensure that the pallet has enough funding. This should already be the case, but
189+
// a rounding error can cause it to fail.
190+
T::Currency::set_balance(&Nis::<T>::account_id(), BalanceOf::<T>::max_value() / 10u32.into());
185191
}: _(RawOrigin::Signed(caller.clone()), 0)
186192
verify {
187193
assert!(Receipts::<T>::get(0).is_none());

0 commit comments

Comments
 (0)