Skip to content

Commit

Permalink
fee: fix bug in tier application
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence committed May 6, 2024
1 parent a0baeda commit 5e85631
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions crates/core/component/fee/src/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}
}
}
Expand Down

0 comments on commit 5e85631

Please sign in to comment.