Skip to content

Commit 253d807

Browse files
committed
impl
1 parent 1b0c63a commit 253d807

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

pallets/subtensor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ pub mod pallet {
17851785
}
17861786

17871787
/// Ensure subtoken enalbed
1788-
pub fn ensure_subtoken_enabled(subnet: u16) -> DispatchResult {
1788+
pub fn ensure_subtoken_enabled(subnet: u16) -> Result<(), Error<T>> {
17891789
ensure!(
17901790
SubtokenEnabled::<T>::get(subnet),
17911791
Error::<T>::SubtokenDisabled

pallets/subtensor/src/staking/stake_utils.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,9 @@ impl<T: Config> Pallet<T> {
911911
// Ensure that the subnet exists.
912912
ensure!(Self::if_subnet_exist(netuid), Error::<T>::SubnetNotExists);
913913

914+
// Ensure that the subnet is enabled.
915+
Self::ensure_subtoken_enabled(netuid)?;
916+
914917
// Get the minimum balance (and amount) that satisfies the transaction
915918
let min_amount = DefaultMinStake::<T>::get().saturating_add(DefaultStakingFee::<T>::get());
916919

@@ -964,6 +967,9 @@ impl<T: Config> Pallet<T> {
964967
// Ensure that the subnet exists.
965968
ensure!(Self::if_subnet_exist(netuid), Error::<T>::SubnetNotExists);
966969

970+
// Ensure that the subnet is enabled.
971+
Self::ensure_subtoken_enabled(netuid)?;
972+
967973
// Ensure that the stake amount to be removed is above the minimum in tao equivalent.
968974
if let Some(tao_equivalent) = Self::sim_swap_alpha_for_tao(netuid, alpha_unstaked) {
969975
ensure!(

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
209209
// `spec_version`, and `authoring_version` are the same between Wasm and native.
210210
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
211211
// the compatible custom types.
212-
spec_version: 273,
212+
spec_version: 274,
213213
impl_version: 1,
214214
apis: RUNTIME_API_VERSIONS,
215215
transaction_version: 1,

0 commit comments

Comments
 (0)