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

Changed LPFee to Permill type in Asset Conversion Pallet #14823

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
moved to .deconstruct()
  • Loading branch information
PatricioNapoli committed Aug 24, 2023
commit fb6ea183b8c5fd90f1003526efded1871697090c
6 changes: 4 additions & 2 deletions frame/asset-conversion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,8 @@ pub mod pallet {
return Err(Error::<T>::ZeroLiquidity.into())
}

let fee_mult = T::HigherPrecisionBalance::from(1_000_000u32 - T::LPFee::get() * 1_u32);
let fee_mult =
T::HigherPrecisionBalance::from(1_000_000u32 - T::LPFee::get().deconstruct());

let amount_in_with_fee =
amount_in.checked_mul(&fee_mult).ok_or(Error::<T>::Overflow)?;
Expand Down Expand Up @@ -1170,7 +1171,8 @@ pub mod pallet {
.checked_mul(&1000u32.into())
.ok_or(Error::<T>::Overflow)?;

let fee_mult = T::HigherPrecisionBalance::from(1_000_000u32 - T::LPFee::get() * 1_u32);
let fee_mult =
T::HigherPrecisionBalance::from(1_000_000u32 - T::LPFee::get().deconstruct());
Copy link
Contributor

@xlc xlc Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just confusing and not a good usage of Permill type


let denominator = reserve_out
.checked_sub(&amount_out)
Expand Down