Skip to content

Commit e43afcd

Browse files
committed
tests
1 parent 253d807 commit e43afcd

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

pallets/subtensor/src/tests/subnet.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ fn test_subtoken_enable_reject_trading_before_enable() {
251251
let hotkey_account_2_id: U256 = U256::from(3);
252252
let amount = DefaultMinStake::<Test>::get() * 10;
253253

254+
let limit_price = 1000; // not important
255+
254256
add_network_disable_subtoken(netuid, 10, 0);
255257
add_network_disable_subtoken(netuid2, 10, 0);
256258

@@ -273,6 +275,46 @@ fn test_subtoken_enable_reject_trading_before_enable() {
273275
Error::<Test>::SubtokenDisabled
274276
);
275277

278+
assert_noop!(
279+
SubtensorModule::add_stake_limit(
280+
RuntimeOrigin::signed(coldkey_account_id),
281+
hotkey_account_id,
282+
netuid,
283+
amount,
284+
limit_price,
285+
false
286+
),
287+
Error::<Test>::SubtokenDisabled
288+
);
289+
290+
assert_noop!(
291+
SubtensorModule::unstake_all(
292+
RuntimeOrigin::signed(coldkey_account_id),
293+
hotkey_account_id
294+
),
295+
Error::<Test>::SubtokenDisabled
296+
);
297+
298+
assert_noop!(
299+
SubtensorModule::unstake_all_alpha(
300+
RuntimeOrigin::signed(coldkey_account_id),
301+
hotkey_account_id
302+
),
303+
Error::<Test>::SubtokenDisabled
304+
);
305+
306+
assert_noop!(
307+
SubtensorModule::remove_stake_limit(
308+
RuntimeOrigin::signed(coldkey_account_id),
309+
hotkey_account_id,
310+
netuid,
311+
amount,
312+
limit_price,
313+
false
314+
),
315+
Error::<Test>::SubtokenDisabled
316+
);
317+
276318
assert_noop!(
277319
SubtensorModule::remove_stake(
278320
RuntimeOrigin::signed(coldkey_account_id),

0 commit comments

Comments
 (0)