fn accrue_interest_rate(underlying_asset: CurrencyId) -> DispatchResult {
		let current_block_number = <frame_system::Pallet<T>>::block_number();
		if Self::controller_dates(underlying_asset).last_interest_accrued_block == current_block_number {
			return Ok(());
		}

		let pool_data = Self::calculate_current_pool_data(underlying_asset)?;
		// Save new params
		ControllerParams::<T>::mutate(underlying_asset, |data| {
			data.last_interest_accrued_block = current_block_number
		});
		<LiquidityPools<T>>::set_pool_data(
			underlying_asset,
			pool_data.total_borrowed,
			pool_data.borrow_index,
			pool_data.total_protocol_interest,
		);

		Ok(())
	}
/// Applies accrued interest to total borrows and protocol interest.
/// This calculates interest accrued from the last checkpointed block
/// up to the current block and writes new checkpoint to storage.
Applies accrued interest to total borrows and protocol interest.
This calculates interest accrued from the last checkpointed block
up to the current block and writes new checkpoint to storage.
Applies accrued interest to total borrows and protocol interest . This calculates interest accrued from the last checkpointed block up to the current block and writes new checkpoint to storage .
fn accrue_interest_rate(underlying_asset: CurrencyId) -> DispatchResult {
		let current_block_number = <frame_system::Pallet<T>>::block_number();
		if Self::controller_dates(underlying_asset).last_interest_accrued_block == current_block_number {
			return Ok(());
		}
		let pool_data = Self::calculate_current_pool_data(underlying_asset)?;
		// Save new params
		ControllerParams::<T>::mutate(underlying_asset, |data| {
			data.last_interest_accrued_block = current_block_number
		});
		<LiquidityPools<T>>::set_pool_data(
			underlying_asset,
			pool_data.total_borrowed,
			pool_data.borrow_index,
			pool_data.total_protocol_interest,
		);
		Ok(())
	}
fn accrue_interest_rate ( underlying_asset : CurrencyId ) -> DispatchResult { let current_block_number = < frame_system :: Pallet < T > > :: block_number ( ) ; if Self :: controller_dates ( underlying_asset ) . last_interest_accrued_block == current_block_number { return Ok ( ( ) ) ; } let pool_data = Self :: calculate_current_pool_data ( underlying_asset ) ? ; // Save new params ControllerParams :: < T > :: mutate ( underlying_asset , | data | { data . last_interest_accrued_block = current_block_number } ) ; < LiquidityPools < T > > :: set_pool_data ( underlying_asset , pool_data . total_borrowed , pool_data . borrow_index , pool_data . total_protocol_interest , ) ; Ok ( ( ) ) }
Applies accrued interest to total borrows and protocol interest.
Applies accrued interest to total borrows and protocol interest .
underlying_asset
CurrencyId
underlying_asset
CurrencyId