Skip to content

Commit

Permalink
fix: change error type.
Browse files Browse the repository at this point in the history
  • Loading branch information
nakul1010 committed Dec 4, 2023
1 parent 3dfeb00 commit 8d768a8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/fee/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub use pallet::*;
use primitives::VaultId;
use reward::RewardsApi;
use sp_arithmetic::{traits::*, FixedPointNumber};
use sp_runtime::{traits::AccountIdConversion, TransactionOutcome};
use sp_runtime::{traits::AccountIdConversion, ArithmeticError, TransactionOutcome};
use sp_std::{
convert::{TryFrom, TryInto},
fmt::Debug,
Expand Down Expand Up @@ -111,8 +111,6 @@ pub mod pallet {
TryIntoIntError,
/// Value exceeds the expected upper bound for storage fields in this pallet.
AboveMaxExpectedValue,
/// Subtraction of the premium redeem fee from a value failed.
PremiumRedeemSubtractionFailed,
}

#[pallet::hooks]
Expand Down Expand Up @@ -439,7 +437,7 @@ impl<T: Config> Pallet<T> {
) -> Result<UnsignedFixedPoint<T>, DispatchError> {
Ok(amount
.checked_sub(&<PremiumRedeemFee<T>>::get())
.ok_or(Error::<T>::PremiumRedeemSubtractionFailed)?)
.ok_or(ArithmeticError::Underflow)?)
}

/// Calculate punishment fee for a Vault that fails to execute a redeem
Expand Down

0 comments on commit 8d768a8

Please sign in to comment.