File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ! (
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments