From 805e2fd7701a6da02f41c3f55d7655e5dd631943 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Sat, 4 May 2024 23:13:00 -0700 Subject: [PATCH] fee: fix bug in tier application --- crates/core/component/fee/src/fee.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/core/component/fee/src/fee.rs b/crates/core/component/fee/src/fee.rs index cf60e8b053..fb2f7f1152 100644 --- a/crates/core/component/fee/src/fee.rs +++ b/crates/core/component/fee/src/fee.rs @@ -57,15 +57,24 @@ impl Fee { match fee_tier { FeeTier::Low => { let amount = (self.amount() * FEE_TIER_LOW_MULTIPLIER.into()) / 100u32.into(); - Self::from_staking_token_amount(amount) + Self(Value { + amount, + asset_id: self.0.asset_id, + }) } FeeTier::Medium => { let amount = (self.amount() * FEE_TIER_MEDIUM_MULTIPLIER.into()) / 100u32.into(); - Self::from_staking_token_amount(amount) + Self(Value { + amount, + asset_id: self.0.asset_id, + }) } FeeTier::High => { let amount = (self.amount() * FEE_TIER_HIGH_MULTIPLIER.into()) / 100u32.into(); - Self::from_staking_token_amount(amount) + Self(Value { + amount, + asset_id: self.0.asset_id, + }) } } }