Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pallets/subtensor/src/staking/stake_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ impl<T: Config> Pallet<T> {
ensure!(Self::if_subnet_exist(netuid), Error::<T>::SubnetNotExists);

// Ensure that the subnet is enabled.
Self::ensure_subtoken_enabled(netuid)?;
// Self::ensure_subtoken_enabled(netuid)?;

// Ensure that the stake amount to be removed is above the minimum in tao equivalent.
if let Some(tao_equivalent) = Self::sim_swap_alpha_for_tao(netuid, alpha_unstaked) {
Expand Down
24 changes: 12 additions & 12 deletions pallets/subtensor/src/tests/subnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ fn test_subtoken_enable() {
});
}

// cargo test --package pallet-subtensor --lib -- tests::subnet::test_subtoken_enable_reject_trading_before_enable --exact --show-output
// cargo test --package pallet-subtensor --lib --
// tests::subnet::test_subtoken_enable_reject_trading_before_enable --exact --show-output
#[allow(clippy::unwrap_used)]
#[test]
fn test_subtoken_enable_reject_trading_before_enable() {
// ensure_subtoken_enabled
Expand Down Expand Up @@ -340,17 +342,15 @@ fn test_subtoken_enable_reject_trading_before_enable() {
stake_bal
);

assert_noop!(
SubtensorModule::remove_stake_limit(
RuntimeOrigin::signed(coldkey_account_id),
hotkey_account_id,
netuid,
amount,
limit_price,
false
),
Error::<Test>::SubtokenDisabled
);
SubtensorModule::remove_stake_limit(
RuntimeOrigin::signed(coldkey_account_id),
hotkey_account_id,
netuid,
amount,
limit_price,
false,
)
.unwrap();

assert_noop!(
SubtensorModule::remove_stake(
Expand Down
Loading