Skip to content

Commit cbf5be0

Browse files
committed
add recycle alpha helper function
1 parent d1e1967 commit cbf5be0

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

pallets/subtensor/src/coinbase/run_coinbase.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ impl<T: Config> Pallet<T> {
830830
parent_emission = parent_emission.saturating_sub(child_take);
831831
total_child_take = total_child_take.saturating_add(child_take);
832832

833-
Self::burn_subnet_alpha(
833+
Self::recycle_subnet_alpha(
834834
netuid,
835835
AlphaCurrency::from(burn_take.saturating_to_num::<u64>()),
836836
);

pallets/subtensor/src/staking/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl<T: Config> Pallet<T> {
322322
T::SwapInterface::is_user_liquidity_enabled(netuid)
323323
}
324324

325-
pub fn burn_subnet_alpha(netuid: NetUid, amount: AlphaCurrency) {
325+
pub fn recycle_subnet_alpha(netuid: NetUid, amount: AlphaCurrency) {
326326
SubnetAlphaOut::<T>::mutate(netuid, |total| {
327327
*total = total.saturating_sub(amount);
328328
});

pallets/subtensor/src/staking/recycle_alpha.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ impl<T: Config> Pallet<T> {
5959
);
6060

6161
// Recycle means we should decrease the alpha issuance tracker.
62-
SubnetAlphaOut::<T>::mutate(netuid, |total| {
63-
*total = total.saturating_sub(actual_alpha_decrease);
64-
});
62+
Self::recycle_subnet_alpha(netuid, amount);
6563

6664
Self::deposit_event(Event::AlphaRecycled(
6765
coldkey,

0 commit comments

Comments
 (0)