Skip to content

Commit 37506bd

Browse files
authored
Merge pull request #2029 from opentensor/recycle_alpha_helper
add recycle alpha helper function
2 parents d1e1967 + 8d9ff93 commit 37506bd

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::*;
22
use crate::{Error, system::ensure_signed};
3-
use subtensor_runtime_common::{AlphaCurrency, Currency, NetUid};
3+
use subtensor_runtime_common::{AlphaCurrency, NetUid};
44

55
impl<T: Config> Pallet<T> {
66
/// Recycles alpha from a cold/hot key pair, reducing AlphaOut on a subnet
@@ -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,

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
220220
// `spec_version`, and `authoring_version` are the same between Wasm and native.
221221
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
222222
// the compatible custom types.
223-
spec_version: 312,
223+
spec_version: 313,
224224
impl_version: 1,
225225
apis: RUNTIME_API_VERSIONS,
226226
transaction_version: 1,

0 commit comments

Comments
 (0)