@@ -199,9 +199,9 @@ impl<T: Config> Pallet<T> {
199
199
mining_emission : u64 ,
200
200
) {
201
201
// --- 1. First, calculate the hotkey's share of the emission.
202
- let childkey_take_proportion: I64F64 =
203
- I64F64 :: from_num ( Self :: get_childkey_take ( hotkey, netuid) )
204
- . saturating_div ( I64F64 :: from_num ( u16:: MAX ) ) ;
202
+ let childkey_take_proportion: I96F32 =
203
+ I96F32 :: from_num ( Self :: get_childkey_take ( hotkey, netuid) )
204
+ . saturating_div ( I96F32 :: from_num ( u16:: MAX ) ) ;
205
205
let mut total_childkey_take: u64 = 0 ;
206
206
207
207
// --- 2. Track the remaining emission for accounting purposes.
@@ -225,19 +225,21 @@ impl<T: Config> Pallet<T> {
225
225
) ;
226
226
let proportion_from_parent: I96F32 =
227
227
stake_from_parent. saturating_div ( I96F32 :: from_num ( total_hotkey_stake) ) ;
228
- let parent_emission: u64 = proportion_from_parent
229
- . saturating_mul ( I96F32 :: from_num ( validating_emission) )
230
- . to_num :: < u64 > ( ) ;
228
+ let parent_emission: I96F32 =
229
+ proportion_from_parent. saturating_mul ( I96F32 :: from_num ( validating_emission) ) ;
231
230
232
231
// --- 4.3 Childkey take as part of parent emission
233
232
let child_emission_take: u64 = childkey_take_proportion
234
- . saturating_mul ( I64F64 :: from_num ( parent_emission) )
233
+ . saturating_mul ( parent_emission)
235
234
. to_num :: < u64 > ( ) ;
236
- total_childkey_take = total_childkey_take. saturating_add ( child_emission_take) ;
235
+ total_childkey_take =
236
+ total_childkey_take. saturating_add ( child_emission_take) ;
237
237
// NOTE: Only the validation emission should be split amongst parents.
238
238
239
239
// --- 4.4 Compute the remaining parent emission after the childkey's share is deducted.
240
- let parent_emission_take: u64 = parent_emission. saturating_sub ( child_emission_take) ;
240
+ let parent_emission_take: u64 = parent_emission
241
+ . to_num :: < u64 > ( )
242
+ . saturating_sub ( child_emission_take) ;
241
243
242
244
// --- 4.5. Accumulate emissions for the parent hotkey.
243
245
PendingdHotkeyEmission :: < T > :: mutate ( parent, |parent_accumulated| {
0 commit comments