Skip to content

Commit

Permalink
fix: code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nakul1010 committed Jan 1, 2024
1 parent b9b547d commit 3867379
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/vault-registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1706,9 +1706,12 @@ impl<T: Config> Pallet<T> {

let request_redeem_tokens_for_max_premium = vault_to_burn_tokens.checked_div(&amount_wrapped).ok()?;

if Self::ensure_not_banned(&vault_id).is_ok() && !request_redeem_tokens_for_max_premium.is_zero()
// need `will_be_below_premium_threshold` check as `inclusion_fee` will be a non zero amount, hence `request_redeem_tokens_for_max_premium` will also be a non zero amount
&& Self::will_be_below_premium_threshold(&vault_id).unwrap_or(false)
if Self::ensure_not_banned(&vault_id).is_ok()
&& !request_redeem_tokens_for_max_premium.is_zero()
// Need to check `will_be_below_premium_threshold` to handle a corner case
// where the vault is above PremiumThreshold, but `request_redeem_tokens_for_max_premium` is being calculated as a non-zero amount
// since the `inclusion_fee` is a non-zero amount.
&& Self::will_be_below_premium_threshold(&vault_id).unwrap_or(false)
{
Some((vault_id, request_redeem_tokens_for_max_premium))
} else {
Expand Down

0 comments on commit 3867379

Please sign in to comment.