File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ impl<T: Config> Pallet<T> {
45
45
log:: debug!( "All subnet netuids: {:?}" , subnets) ;
46
46
47
47
// --- 2. Get sum of tao reserves ( in a later version we will switch to prices. )
48
- let mut total_moving_prices: I96F32 = I96F32 :: from_num ( 0.0 ) ;
48
+ let mut total_moving_prices: I96F32 = I96F32 :: saturating_from_num ( 0.0 ) ;
49
49
for netuid_i in subnets. iter ( ) {
50
50
// Get and update the moving price of each subnet adding the total together.
51
51
total_moving_prices =
Original file line number Diff line number Diff line change @@ -121,9 +121,9 @@ impl<T: Config> Pallet<T> {
121
121
Delegates :: < T > :: get ( hotkey)
122
122
}
123
123
pub fn get_hotkey_take_float ( hotkey : & T :: AccountId ) -> I96F32 {
124
- I96F32 :: from_num ( Self :: get_hotkey_take ( hotkey) )
125
- . checked_div ( I96F32 :: from_num ( u16:: MAX ) )
126
- . unwrap_or ( I96F32 :: from_num ( 0.0 ) )
124
+ I96F32 :: saturating_from_num ( Self :: get_hotkey_take ( hotkey) )
125
+ . checked_div ( I96F32 :: saturating_from_num ( u16:: MAX ) )
126
+ . unwrap_or ( I96F32 :: saturating_from_num ( 0.0 ) )
127
127
}
128
128
129
129
/// Returns true if the hotkey account has been created.
You can’t perform that action at this time.
0 commit comments