@@ -67,7 +67,7 @@ pub trait AlphaFeeHandler<T: frame_system::Config> {
6767 coldkey : & AccountIdOf < T > ,
6868 alpha_vec : & [ ( AccountIdOf < T > , NetUid ) ] ,
6969 tao_amount : TaoBalance ,
70- ) -> ( AlphaBalance , TaoBalance ) ;
70+ ) -> ( AlphaBalance , TaoBalance , NetUid ) ;
7171 fn get_all_netuids_for_coldkey_and_hotkey (
7272 coldkey : & AccountIdOf < T > ,
7373 hotkey : & AccountIdOf < T > ,
@@ -154,9 +154,9 @@ where
154154 coldkey : & AccountIdOf < T > ,
155155 alpha_vec : & [ ( AccountIdOf < T > , NetUid ) ] ,
156156 tao_amount : TaoBalance ,
157- ) -> ( AlphaBalance , TaoBalance ) {
157+ ) -> ( AlphaBalance , TaoBalance , NetUid ) {
158158 if alpha_vec. len ( ) != 1 {
159- return ( 0 . into ( ) , 0 . into ( ) ) ;
159+ return ( 0 . into ( ) , 0 . into ( ) , NetUid :: ROOT ) ;
160160 }
161161
162162 if let Some ( ( hotkey, netuid) ) = alpha_vec. first ( ) {
@@ -184,12 +184,12 @@ where
184184 ) ;
185185
186186 if let Ok ( tao_amount) = swap_result {
187- ( alpha_fee, tao_amount)
187+ ( alpha_fee, tao_amount, * netuid )
188188 } else {
189- ( 0 . into ( ) , 0 . into ( ) )
189+ ( 0 . into ( ) , 0 . into ( ) , NetUid :: ROOT )
190190 }
191191 } else {
192- ( 0 . into ( ) , 0 . into ( ) )
192+ ( 0 . into ( ) , 0 . into ( ) , NetUid :: ROOT )
193193 }
194194 }
195195
@@ -215,7 +215,7 @@ pub enum WithdrawnFee<T: frame_system::Config, F: Balanced<AccountIdOf<T>>> {
215215 // Contains withdrawn TAO amount
216216 Tao ( Credit < AccountIdOf < T > , F > ) ,
217217 // Contains withdrawn Alpha amount and resulting swapped TAO
218- Alpha ( ( AlphaBalance , TaoBalance ) ) ,
218+ Alpha ( ( AlphaBalance , TaoBalance , NetUid ) ) ,
219219}
220220
221221/// Custom OnChargeTransaction implementation based on standard FungibleAdapter from transaction_payment
@@ -336,9 +336,9 @@ where
336336 let alpha_vec = Self :: fees_in_alpha :: < T > ( who, call) ;
337337 if !alpha_vec. is_empty ( ) {
338338 let fee_u64: u64 = fee. saturated_into :: < u64 > ( ) ;
339- let ( alpha_fee, tao_amount) =
339+ let ( alpha_fee, tao_amount, netuid ) =
340340 OU :: withdraw_in_alpha ( who, & alpha_vec, fee_u64. into ( ) ) ;
341- return Ok ( Some ( WithdrawnFee :: Alpha ( ( alpha_fee, tao_amount) ) ) ) ;
341+ return Ok ( Some ( WithdrawnFee :: Alpha ( ( alpha_fee, tao_amount, netuid ) ) ) ) ;
342342 }
343343 Err ( InvalidTransaction :: Payment . into ( ) )
344344 }
@@ -405,7 +405,7 @@ where
405405 let ( tip, fee) = adjusted_paid. split ( tip) ;
406406 OU :: on_unbalanceds ( Some ( fee) . into_iter ( ) . chain ( Some ( tip) ) ) ;
407407 }
408- WithdrawnFee :: Alpha ( ( alpha_fee, tao_amount) ) => {
408+ WithdrawnFee :: Alpha ( ( alpha_fee, tao_amount, netuid ) ) => {
409409 if let Some ( author) = T :: author ( ) {
410410 // Pay block author
411411 let _ = F :: deposit ( & author, tao_amount. into ( ) , Precision :: BestEffort )
@@ -416,6 +416,7 @@ where
416416 frame_system:: Pallet :: < T > :: deposit_event (
417417 pallet_subtensor:: Event :: < T > :: TransactionFeePaidWithAlpha {
418418 who : who. clone ( ) ,
419+ netuid,
419420 alpha_fee,
420421 tao_amount,
421422 } ,
0 commit comments