Skip to content

Commit

Permalink
change div to checked_div method
Browse files Browse the repository at this point in the history
  • Loading branch information
SunTiebing committed Dec 31, 2024
1 parent c30a470 commit ba4740b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pallets/channel-commission/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ use frame_support::{
};
use frame_system::EnsureSignedBy;
use sp_core::ConstU32;
use sp_runtime::traits::Scale;
use sp_runtime::{traits::AccountIdConversion, AccountId32, BuildStorage, DispatchError};
use std::ops::Div;

pub type BlockNumber = u64;
pub type Amount = i128;
Expand Down Expand Up @@ -185,7 +183,7 @@ impl VtokenMintingInterface<AccountId, CurrencyId, Balance> for SimpleVtokenMint
_vtoken_id: CurrencyId,
token_amount: Balance,
) -> Result<Balance, DispatchError> {
Ok(token_amount.div(2u64))
Ok(token_amount.checked_div(2u64).unwrap())
}

fn get_currency_amount_by_v_currency_amount(
Expand Down

0 comments on commit ba4740b

Please sign in to comment.