Skip to content

Commit

Permalink
Removed unnecessary math
Browse files Browse the repository at this point in the history
  • Loading branch information
BradleyOlson64 committed Jun 28, 2024
1 parent ded76d0 commit e3084c9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions frame/dynamic-fee/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mod tests;
use frame_support::{inherent::IsFatalError, traits::Get, weights::Weight};
use sp_core::U256;
use sp_inherents::{InherentData, InherentIdentifier};
use sp_std::cmp::{max, min};
use sp_std::cmp::max;

pub use self::pallet::*;
#[cfg(feature = "std")]
Expand Down Expand Up @@ -59,11 +59,9 @@ pub mod pallet {
if let Some(target) = TargetMinGasPrice::<T>::take() {
let bound =
MinGasPrice::<T>::get() / T::MinGasPriceBoundDivisor::get() + U256::one();

let upper_limit = MinGasPrice::<T>::get().saturating_add(bound);
let lower_limit = MinGasPrice::<T>::get().saturating_sub(bound);

MinGasPrice::<T>::set(min(upper_limit, max(lower_limit, target)));
MinGasPrice::<T>::set(max(lower_limit, target));
}
}
}
Expand Down

0 comments on commit e3084c9

Please sign in to comment.