Enforce 2dp on payout withdrawals (#4829)

* fix mural withdraw amount

* Enforce 2dp on all payout logic
This commit is contained in:
aecsocket
2025-11-27 10:03:34 +00:00
committed by GitHub
parent be3208c5a1
commit dfe087df20
9 changed files with 307 additions and 43 deletions

View File

@@ -252,9 +252,9 @@ pub struct PayoutMethodFee {
}
impl PayoutMethodFee {
pub fn compute_fee(&self, value: Decimal) -> Decimal {
pub fn compute_fee(&self, value: impl Into<Decimal>) -> Decimal {
cmp::min(
cmp::max(self.min, self.percentage * value),
cmp::max(self.min, self.percentage * value.into()),
self.max.unwrap_or(Decimal::MAX),
)
}