Skip to content

Commit 4c9836f

Browse files
authored
Merge pull request #1732 from opentensor/sam-hotfix-hotfix
remove subnet enabled check on validate_remove_stake
2 parents f2d6939 + 5f552ae commit 4c9836f

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pallets/subtensor/src/staking/stake_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ impl<T: Config> Pallet<T> {
968968
ensure!(Self::if_subnet_exist(netuid), Error::<T>::SubnetNotExists);
969969

970970
// Ensure that the subnet is enabled.
971-
Self::ensure_subtoken_enabled(netuid)?;
971+
// Self::ensure_subtoken_enabled(netuid)?;
972972

973973
// Ensure that the stake amount to be removed is above the minimum in tao equivalent.
974974
if let Some(tao_equivalent) = Self::sim_swap_alpha_for_tao(netuid, alpha_unstaked) {

pallets/subtensor/src/tests/subnet.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ fn test_subtoken_enable() {
239239
});
240240
}
241241

242-
// cargo test --package pallet-subtensor --lib -- tests::subnet::test_subtoken_enable_reject_trading_before_enable --exact --show-output
242+
// cargo test --package pallet-subtensor --lib --
243+
// tests::subnet::test_subtoken_enable_reject_trading_before_enable --exact --show-output
244+
#[allow(clippy::unwrap_used)]
243245
#[test]
244246
fn test_subtoken_enable_reject_trading_before_enable() {
245247
// ensure_subtoken_enabled
@@ -340,17 +342,15 @@ fn test_subtoken_enable_reject_trading_before_enable() {
340342
stake_bal
341343
);
342344

343-
assert_noop!(
344-
SubtensorModule::remove_stake_limit(
345-
RuntimeOrigin::signed(coldkey_account_id),
346-
hotkey_account_id,
347-
netuid,
348-
amount,
349-
limit_price,
350-
false
351-
),
352-
Error::<Test>::SubtokenDisabled
353-
);
345+
SubtensorModule::remove_stake_limit(
346+
RuntimeOrigin::signed(coldkey_account_id),
347+
hotkey_account_id,
348+
netuid,
349+
amount,
350+
limit_price,
351+
false,
352+
)
353+
.unwrap();
354354

355355
assert_noop!(
356356
SubtensorModule::remove_stake(

0 commit comments

Comments
 (0)