@@ -1886,94 +1886,4 @@ fn test_coldkey_delegations() {
1886
1886
assert_eq ! ( Stake :: <Test >:: get( delegate, new_coldkey) , 100 ) ;
1887
1887
assert_eq ! ( Stake :: <Test >:: get( delegate, coldkey) , 0 ) ;
1888
1888
} ) ;
1889
- }
1890
-
1891
- // SKIP_WASM_BUILD=1 RUST_LOG=info cargo test --test swap -- test_sudo_hotfix_swap_coldkey_delegates --exact --nocapture
1892
- // #[test]
1893
- // fn test_sudo_hotfix_swap_coldkey_delegates() {
1894
- // new_test_ext(1).execute_with(|| {
1895
- // let new_coldkey = U256::from(0);
1896
- // let owner = U256::from(1);
1897
- // let coldkey = U256::from(4);
1898
- // let delegate = U256::from(2);
1899
- // let netuid = 1u16;
1900
- // add_network(netuid, 13, 0);
1901
- // register_ok_neuron(netuid, delegate, owner, 0);
1902
- // SubtensorModule::add_balance_to_coldkey_account(&coldkey, 1000);
1903
- // assert_ok!(SubtensorModule::do_become_delegate(
1904
- // <<Test as Config>::RuntimeOrigin>::signed(owner),
1905
- // delegate,
1906
- // u16::MAX / 10
1907
- // ));
1908
- // assert_ok!(SubtensorModule::add_stake(
1909
- // <<Test as Config>::RuntimeOrigin>::signed(coldkey),
1910
- // delegate,
1911
- // 100
1912
- // ));
1913
-
1914
- // assert_ok!(SubtensorModule::perform_swap_coldkey(
1915
- // &coldkey,
1916
- // &new_coldkey
1917
- // ));
1918
-
1919
- // assert_ok!(AdminUtils::sudo_hotfix_swap_coldkey_delegates(
1920
- // <<Test as Config>::RuntimeOrigin>::root(),
1921
- // to_be_set
1922
- // ));
1923
-
1924
- // assert_eq!( SubtensorModule::get_total_stake_for_hotkey( &delegate), 100 );
1925
- // assert_eq!( SubtensorModule::get_total_stake_for_coldkey( &coldkey), 0 );
1926
- // assert_eq!( SubtensorModule::get_total_stake_for_coldkey( &new_coldkey), 100 );
1927
- // assert_eq!( Stake::<Test>::get( delegate, new_coldkey ), 100 );
1928
- // assert_eq!( Stake::<Test>::get( delegate, coldkey ), 0 );
1929
-
1930
- // });
1931
- // }
1932
-
1933
- // SKIP_WASM_BUILD=1 RUST_LOG=info cargo test --test swap -- test_sudo_hotfix_swap_coldkey_delegates --exact --nocapture
1934
- #[ test]
1935
- fn test_sudo_hotfix_swap_coldkey_delegates ( ) {
1936
- new_test_ext ( 1 ) . execute_with ( || {
1937
- let new_coldkey = U256 :: from ( 0 ) ;
1938
- let coldkey = U256 :: from ( 4 ) ;
1939
- assert_ok ! ( SubtensorModule :: sudo_hotfix_swap_coldkey_delegates(
1940
- <<Test as Config >:: RuntimeOrigin >:: root( ) ,
1941
- coldkey,
1942
- new_coldkey
1943
- ) ) ;
1944
- } ) ;
1945
- }
1946
-
1947
- // SKIP_WASM_BUILD=1 RUST_LOG=info cargo test --test swap -- test_sudo_hotfix_swap_coldkey_delegates_with_broken_stake --exact --nocapture
1948
- #[ test]
1949
- fn test_sudo_hotfix_swap_coldkey_delegates_with_broken_stake ( ) {
1950
- new_test_ext ( 1 ) . execute_with ( || {
1951
- let new_coldkey = U256 :: from ( 0 ) ;
1952
- let old_coldkey = U256 :: from ( 4 ) ;
1953
- let h1 = U256 :: from ( 5 ) ;
1954
- let h2 = U256 :: from ( 6 ) ;
1955
- let h3 = U256 :: from ( 7 ) ;
1956
- Stake :: < Test > :: insert ( h3, old_coldkey, 100 ) ;
1957
- Stake :: < Test > :: insert ( h2, old_coldkey, 100 ) ;
1958
- assert_eq ! ( Stake :: <Test >:: get( h3, old_coldkey) , 100 ) ;
1959
- assert_eq ! ( Stake :: <Test >:: get( h2, old_coldkey) , 100 ) ;
1960
- StakingHotkeys :: < Test > :: insert ( new_coldkey, vec ! [ h1, h2] ) ;
1961
- StakingHotkeys :: < Test > :: insert ( old_coldkey, vec ! [ h3, h2] ) ;
1962
- assert_ok ! ( SubtensorModule :: sudo_hotfix_swap_coldkey_delegates(
1963
- <<Test as Config >:: RuntimeOrigin >:: root( ) ,
1964
- old_coldkey,
1965
- new_coldkey
1966
- ) ) ;
1967
- let hotkeys = StakingHotkeys :: < Test > :: get ( new_coldkey) ;
1968
- assert_eq ! ( hotkeys. len( ) , 3 ) ;
1969
- assert_eq ! ( hotkeys[ 0 ] , h1) ;
1970
- assert_eq ! ( hotkeys[ 1 ] , h2) ;
1971
- assert_eq ! ( hotkeys[ 2 ] , h3) ;
1972
- let hotkeys_old = StakingHotkeys :: < Test > :: get ( old_coldkey) ;
1973
- assert_eq ! ( hotkeys_old. len( ) , 0 ) ;
1974
- assert_eq ! ( Stake :: <Test >:: get( h3, old_coldkey) , 0 ) ;
1975
- assert_eq ! ( Stake :: <Test >:: get( h2, old_coldkey) , 0 ) ;
1976
- assert_eq ! ( Stake :: <Test >:: get( h3, new_coldkey) , 100 ) ;
1977
- assert_eq ! ( Stake :: <Test >:: get( h2, new_coldkey) , 100 ) ;
1978
- } ) ;
1979
- }
1889
+ }
0 commit comments