3
3
mod mock;
4
4
use frame_support:: assert_ok;
5
5
use frame_system:: Config ;
6
- use pallet_subtensor:: * ;
7
6
use mock:: * ;
7
+ use pallet_subtensor:: * ;
8
8
use sp_core:: U256 ;
9
9
10
10
#[ test]
@@ -278,12 +278,11 @@ fn test_migration_delete_subnet_21() {
278
278
} )
279
279
}
280
280
281
-
282
281
// SKIP_WASM_BUILD=1 RUST_LOG=info cargo test --test migration -- test_migrate_fix_total_coldkey_stake --exact --nocapture
283
282
#[ test]
284
283
fn test_migrate_fix_total_coldkey_stake ( ) {
285
284
new_test_ext ( 1 ) . execute_with ( || {
286
- let coldkey = U256 :: from ( 0 ) ;
285
+ let coldkey = U256 :: from ( 0 ) ;
287
286
TotalColdkeyStake :: < Test > :: insert ( coldkey, 0 ) ;
288
287
StakingHotkeys :: < Test > :: insert ( coldkey, vec ! [ U256 :: from( 1 ) , U256 :: from( 2 ) , U256 :: from( 3 ) ] ) ;
289
288
Stake :: < Test > :: insert ( U256 :: from ( 1 ) , U256 :: from ( 0 ) , 10000 ) ;
@@ -298,7 +297,7 @@ fn test_migrate_fix_total_coldkey_stake() {
298
297
#[ test]
299
298
fn test_migrate_fix_total_coldkey_stake_value_already_in_total ( ) {
300
299
new_test_ext ( 1 ) . execute_with ( || {
301
- let coldkey = U256 :: from ( 0 ) ;
300
+ let coldkey = U256 :: from ( 0 ) ;
302
301
TotalColdkeyStake :: < Test > :: insert ( coldkey, 100000000 ) ;
303
302
StakingHotkeys :: < Test > :: insert ( coldkey, vec ! [ U256 :: from( 1 ) , U256 :: from( 2 ) , U256 :: from( 3 ) ] ) ;
304
303
Stake :: < Test > :: insert ( U256 :: from ( 1 ) , U256 :: from ( 0 ) , 10000 ) ;
@@ -313,7 +312,7 @@ fn test_migrate_fix_total_coldkey_stake_value_already_in_total() {
313
312
#[ test]
314
313
fn test_migrate_fix_total_coldkey_stake_no_entry ( ) {
315
314
new_test_ext ( 1 ) . execute_with ( || {
316
- let coldkey = U256 :: from ( 0 ) ;
315
+ let coldkey = U256 :: from ( 0 ) ;
317
316
StakingHotkeys :: < Test > :: insert ( coldkey, vec ! [ U256 :: from( 1 ) , U256 :: from( 2 ) , U256 :: from( 3 ) ] ) ;
318
317
Stake :: < Test > :: insert ( U256 :: from ( 1 ) , U256 :: from ( 0 ) , 10000 ) ;
319
318
Stake :: < Test > :: insert ( U256 :: from ( 2 ) , U256 :: from ( 0 ) , 10000 ) ;
@@ -327,7 +326,7 @@ fn test_migrate_fix_total_coldkey_stake_no_entry() {
327
326
#[ test]
328
327
fn test_migrate_fix_total_coldkey_stake_no_entry_in_hotkeys ( ) {
329
328
new_test_ext ( 1 ) . execute_with ( || {
330
- let coldkey = U256 :: from ( 0 ) ;
329
+ let coldkey = U256 :: from ( 0 ) ;
331
330
TotalColdkeyStake :: < Test > :: insert ( coldkey, 100000000 ) ;
332
331
StakingHotkeys :: < Test > :: insert ( coldkey, vec ! [ U256 :: from( 1 ) , U256 :: from( 2 ) , U256 :: from( 3 ) ] ) ;
333
332
pallet_subtensor:: migration:: do_migrate_fix_total_coldkey_stake :: < Test > ( ) ;
@@ -339,7 +338,7 @@ fn test_migrate_fix_total_coldkey_stake_no_entry_in_hotkeys() {
339
338
#[ test]
340
339
fn test_migrate_fix_total_coldkey_stake_one_hotkey_stake_missing ( ) {
341
340
new_test_ext ( 1 ) . execute_with ( || {
342
- let coldkey = U256 :: from ( 0 ) ;
341
+ let coldkey = U256 :: from ( 0 ) ;
343
342
TotalColdkeyStake :: < Test > :: insert ( coldkey, 100000000 ) ;
344
343
StakingHotkeys :: < Test > :: insert ( coldkey, vec ! [ U256 :: from( 1 ) , U256 :: from( 2 ) , U256 :: from( 3 ) ] ) ;
345
344
Stake :: < Test > :: insert ( U256 :: from ( 1 ) , U256 :: from ( 0 ) , 10000 ) ;
@@ -348,5 +347,3 @@ fn test_migrate_fix_total_coldkey_stake_one_hotkey_stake_missing() {
348
347
assert_eq ! ( TotalColdkeyStake :: <Test >:: get( coldkey) , 20000 ) ;
349
348
} )
350
349
}
351
-
352
-
0 commit comments