Skip to content
Snippets Groups Projects
Unverified Commit f903ea2e authored by Liam Aharon's avatar Liam Aharon
Browse files

is_zero()

parent 44191335
Branches
No related merge requests found
Pipeline #465064 canceled with stages
in 2 minutes and 39 seconds
...@@ -90,7 +90,7 @@ use frame_support::{ ...@@ -90,7 +90,7 @@ use frame_support::{
}; };
use scale_info::TypeInfo; use scale_info::TypeInfo;
use sp_core::Get; use sp_core::Get;
use sp_runtime::DispatchError; use sp_runtime::{traits::Zero, DispatchError};
use sp_std::boxed::Box; use sp_std::boxed::Box;
#[cfg(feature = "runtime-benchmarks")] #[cfg(feature = "runtime-benchmarks")]
...@@ -669,7 +669,7 @@ pub mod pallet { ...@@ -669,7 +669,7 @@ pub mod pallet {
/// ///
/// This is a helper function for `update_pool_rewards` and should not be called directly. /// This is a helper function for `update_pool_rewards` and should not be called directly.
fn reward_per_token(pool_info: &PoolInfoFor<T>) -> Result<T::Balance, DispatchError> { fn reward_per_token(pool_info: &PoolInfoFor<T>) -> Result<T::Balance, DispatchError> {
if pool_info.total_tokens_staked.eq(&0u32.into()) { if pool_info.total_tokens_staked.is_zero() {
return Ok(pool_info.reward_per_token_stored) return Ok(pool_info.reward_per_token_stored)
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment