@@ -682,23 +682,23 @@ fn test_sudo_set_max_allowed_validators() {
682
682
}
683
683
684
684
#[ test]
685
- fn test_sudo_set_weights_min_stake ( ) {
685
+ fn test_sudo_set_stake_threshold ( ) {
686
686
new_test_ext ( ) . execute_with ( || {
687
687
let to_be_set: u64 = 10 ;
688
- let init_value: u64 = SubtensorModule :: get_weights_min_stake ( ) ;
688
+ let init_value: u64 = SubtensorModule :: get_stake_threshold ( ) ;
689
689
assert_eq ! (
690
- AdminUtils :: sudo_set_weights_min_stake (
690
+ AdminUtils :: sudo_set_stake_threshold (
691
691
<<Test as Config >:: RuntimeOrigin >:: signed( U256 :: from( 1 ) ) ,
692
692
to_be_set
693
693
) ,
694
694
Err ( DispatchError :: BadOrigin )
695
695
) ;
696
- assert_eq ! ( SubtensorModule :: get_weights_min_stake ( ) , init_value) ;
697
- assert_ok ! ( AdminUtils :: sudo_set_weights_min_stake (
696
+ assert_eq ! ( SubtensorModule :: get_stake_threshold ( ) , init_value) ;
697
+ assert_ok ! ( AdminUtils :: sudo_set_stake_threshold (
698
698
<<Test as Config >:: RuntimeOrigin >:: root( ) ,
699
699
to_be_set
700
700
) ) ;
701
- assert_eq ! ( SubtensorModule :: get_weights_min_stake ( ) , to_be_set) ;
701
+ assert_eq ! ( SubtensorModule :: get_stake_threshold ( ) , to_be_set) ;
702
702
} ) ;
703
703
}
704
704
@@ -1433,3 +1433,36 @@ fn sudo_set_commit_reveal_weights_interval() {
1433
1433
assert_eq ! ( SubtensorModule :: get_reveal_period( netuid) , to_be_set) ;
1434
1434
} ) ;
1435
1435
}
1436
+
1437
+ #[ test]
1438
+ fn test_sudo_root_sets_evm_chain_id ( ) {
1439
+ new_test_ext ( ) . execute_with ( || {
1440
+ let chain_id: u64 = 945 ;
1441
+ assert_eq ! ( pallet_evm_chain_id:: ChainId :: <Test >:: get( ) , 0 ) ;
1442
+
1443
+ assert_ok ! ( AdminUtils :: sudo_set_evm_chain_id(
1444
+ <<Test as Config >:: RuntimeOrigin >:: root( ) ,
1445
+ chain_id
1446
+ ) ) ;
1447
+
1448
+ assert_eq ! ( pallet_evm_chain_id:: ChainId :: <Test >:: get( ) , chain_id) ;
1449
+ } ) ;
1450
+ }
1451
+
1452
+ #[ test]
1453
+ fn test_sudo_non_root_cannot_set_evm_chain_id ( ) {
1454
+ new_test_ext ( ) . execute_with ( || {
1455
+ let chain_id: u64 = 945 ;
1456
+ assert_eq ! ( pallet_evm_chain_id:: ChainId :: <Test >:: get( ) , 0 ) ;
1457
+
1458
+ assert_eq ! (
1459
+ AdminUtils :: sudo_set_evm_chain_id(
1460
+ <<Test as Config >:: RuntimeOrigin >:: signed( U256 :: from( 0 ) ) ,
1461
+ chain_id
1462
+ ) ,
1463
+ Err ( DispatchError :: BadOrigin )
1464
+ ) ;
1465
+
1466
+ assert_eq ! ( pallet_evm_chain_id:: ChainId :: <Test >:: get( ) , 0 ) ;
1467
+ } ) ;
1468
+ }
0 commit comments