Skip to content

Commit

Permalink
Merge pull request #969 from sander2/fix/bounds
Browse files Browse the repository at this point in the history
fix: liquidate_incentive_reserved_factor bounds
  • Loading branch information
gregdhill authored Mar 14, 2023
2 parents 6b153a5 + f2b6622 commit 3508b60
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/loans/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,7 @@ pub mod pallet {
Error::<T>::InvalidFactor,
);
ensure!(
market.liquidate_incentive_reserved_factor > Ratio::zero()
&& market.liquidate_incentive_reserved_factor < Ratio::one(),
market.liquidate_incentive_reserved_factor < Ratio::one(),
Error::<T>::InvalidFactor,
);
ensure!(market.supply_cap > Zero::zero(), Error::<T>::InvalidSupplyCap,);
Expand Down Expand Up @@ -814,6 +813,10 @@ pub mod pallet {
reserve_factor > Ratio::zero() && reserve_factor < Ratio::one(),
Error::<T>::InvalidFactor
);
ensure!(
market.liquidate_incentive_reserved_factor < Ratio::one(),
Error::<T>::InvalidFactor,
);
ensure!(supply_cap > Zero::zero(), Error::<T>::InvalidSupplyCap);

let market = Self::mutate_market(asset_id, |stored_market| {
Expand Down

0 comments on commit 3508b60

Please sign in to comment.