fn calculate_interest_factor(current_borrow_interest_rate: Rate, block_delta: T::BlockNumber) -> RateResult {
		let block_delta_as_usize = TryInto::<usize>::try_into(block_delta)
			.ok()
			.expect("blockchain will not exceed 2^32 blocks; qed");

		let interest_factor: FixedU128 = Rate::saturating_from_integer(block_delta_as_usize as u128)
			.checked_mul(&current_borrow_interest_rate)
			.ok_or(Error::<T>::NumOverflow)?;

		Ok(interest_factor)
	}
/// Calculates the simple interest factor.
/// - `current_borrow_interest_rate`: Current interest rate that users pay for lending assets.
/// - `block_delta`: The number of blocks elapsed since the last accrual.
///
/// returns `interest_factor = current_borrow_interest_rate * block_delta`.
Calculates the simple interest factor.
`current_borrow_interest_rate`: Current interest rate that users pay for lending assets.
`block_delta`: The number of blocks elapsed since the last accrual.


Calculates the simple interest factor . ` current_borrow_interest_rate ` : Current interest rate that users pay for lending assets . ` block_delta ` : The number of blocks elapsed since the last accrual .
fn calculate_interest_factor(current_borrow_interest_rate: Rate, block_delta: T::BlockNumber) -> RateResult {
		let block_delta_as_usize = TryInto::<usize>::try_into(block_delta)
			.ok()
			.expect("blockchain will not exceed 2^32 blocks; qed");
		let interest_factor: FixedU128 = Rate::saturating_from_integer(block_delta_as_usize as u128)
			.checked_mul(&current_borrow_interest_rate)
			.ok_or(Error::<T>::NumOverflow)?;
		Ok(interest_factor)
	}
fn calculate_interest_factor ( current_borrow_interest_rate : Rate , block_delta : T :: BlockNumber ) -> RateResult { let block_delta_as_usize = TryInto :: < usize > :: try_into ( block_delta ) . ok ( ) . expect ( " " ) ; let interest_factor : FixedU128 = Rate :: saturating_from_integer ( block_delta_as_usize as u128 ) . checked_mul ( & current_borrow_interest_rate ) . ok_or ( Error :: < T > :: NumOverflow ) ? ; Ok ( interest_factor ) }
Calculates the simple interest factor.
Calculates the simple interest factor .
current_borrow_interest_rate
Rate
block_delta
T::BlockNumber
current_borrow_interest_rate
Rate
block_delta
T::BlockNumber