@@ -282,6 +282,7 @@ fn test_schedule_dissolve_network_execution_with_coldkey_swap() {
282
282
} )
283
283
}
284
284
285
+ // SKIP_WASM_BUILD=1 RUST_LOG=debug cargo test --package pallet-subtensor --lib -- tests::networks::test_register_subnet_low_lock_cost --exact --show-output --nocapture
285
286
#[ test]
286
287
fn test_register_subnet_low_lock_cost ( ) {
287
288
new_test_ext ( 1 ) . execute_with ( || {
@@ -300,32 +301,34 @@ fn test_register_subnet_low_lock_cost() {
300
301
// Ensure that both Subnet TAO and Subnet Alpha In equal to (actual) lock_cost
301
302
assert_eq ! (
302
303
SubnetTAO :: <Test >:: get( netuid) ,
303
- lock_cost - ExistentialDeposit :: get ( ) ,
304
+ lock_cost,
304
305
) ;
305
306
assert_eq ! (
306
307
SubnetAlphaIn :: <Test >:: get( netuid) ,
307
- lock_cost - ExistentialDeposit :: get ( ) ,
308
+ lock_cost,
308
309
) ;
309
310
} )
310
311
}
311
312
313
+ // SKIP_WASM_BUILD=1 RUST_LOG=debug cargo test --package pallet-subtensor --lib -- tests::networks::test_register_subnet_high_lock_cost --exact --show-output --nocapture
312
314
#[ test]
313
315
fn test_register_subnet_high_lock_cost ( ) {
314
316
new_test_ext ( 1 ) . execute_with ( || {
315
- NetworkMinLockCost :: < Test > :: set ( 1_000_000_000_000 ) ;
316
- NetworkLastLockCost :: < Test > :: set ( 1_000_000_000_000 ) ;
317
+ let lock_cost: u64 = 1_000_000_000_000 ;
318
+ NetworkMinLockCost :: < Test > :: set ( lock_cost) ;
319
+ NetworkLastLockCost :: < Test > :: set ( lock_cost) ;
317
320
318
321
// Make sure lock cost is higher than 100 TAO
319
322
let lock_cost = SubtensorModule :: get_network_lock_cost ( ) ;
320
- assert ! ( lock_cost > 100_000_000_000 ) ;
323
+ assert ! ( lock_cost >= 1_000_000_000_000 ) ;
321
324
322
325
let subnet_owner_coldkey = U256 :: from ( 1 ) ;
323
326
let subnet_owner_hotkey = U256 :: from ( 2 ) ;
324
327
let netuid: u16 = add_dynamic_network ( & subnet_owner_hotkey, & subnet_owner_coldkey) ;
325
328
assert ! ( SubtensorModule :: if_subnet_exist( netuid) ) ;
326
329
327
330
// Ensure that both Subnet TAO and Subnet Alpha In equal to 100 TAO
328
- assert_eq ! ( SubnetTAO :: <Test >:: get( netuid) , 100_000_000_000 , ) ;
329
- assert_eq ! ( SubnetAlphaIn :: <Test >:: get( netuid) , 100_000_000_000 , ) ;
331
+ assert_eq ! ( SubnetTAO :: <Test >:: get( netuid) , lock_cost ) ;
332
+ assert_eq ! ( SubnetAlphaIn :: <Test >:: get( netuid) , lock_cost ) ;
330
333
} )
331
334
}
0 commit comments