Skip to content

Commit c9d0b6f

Browse files
committed
remove become delegate from testing
1 parent ff5da7f commit c9d0b6f

File tree

2 files changed

+1
-51
lines changed

2 files changed

+1
-51
lines changed

pallets/subtensor/src/tests/staking.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,22 +1050,6 @@ fn test_non_existent_account() {
10501050
staking::delegating
10511051
************************************************************/
10521052

1053-
#[test]
1054-
fn test_delegate_stake_division_by_zero_check() {
1055-
new_test_ext(1).execute_with(|| {
1056-
let netuid: u16 = 1;
1057-
let tempo: u16 = 1;
1058-
let hotkey = U256::from(1);
1059-
let coldkey = U256::from(3);
1060-
add_network(netuid, tempo, 0);
1061-
register_ok_neuron(netuid, hotkey, coldkey, 2341312);
1062-
assert_ok!(SubtensorModule::become_delegate(
1063-
RuntimeOrigin::signed(coldkey),
1064-
hotkey
1065-
));
1066-
});
1067-
}
1068-
10691053
#[test]
10701054
fn test_faucet_ok() {
10711055
new_test_ext(1).execute_with(|| {
@@ -1647,12 +1631,6 @@ fn test_get_total_delegated_stake_no_delegations() {
16471631
add_network(netuid, 0, 0);
16481632
register_ok_neuron(netuid, delegate, coldkey, 0);
16491633

1650-
// Make the delegate a delegate
1651-
assert_ok!(SubtensorModule::become_delegate(
1652-
RuntimeOrigin::signed(coldkey),
1653-
delegate
1654-
));
1655-
16561634
// Check that there's no delegated stake
16571635
assert_eq!(SubtensorModule::get_total_stake_for_coldkey(&delegate), 0);
16581636
});
@@ -1780,12 +1758,6 @@ fn test_get_total_delegated_stake_exclude_owner_stake() {
17801758

17811759
let netuid = add_dynamic_network(&delegate_hotkey, &delegate_coldkey);
17821760

1783-
// Make the account a delegate
1784-
assert_ok!(SubtensorModule::become_delegate(
1785-
RuntimeOrigin::signed(delegate_coldkey),
1786-
delegate_hotkey
1787-
));
1788-
17891761
// Add owner stake
17901762
SubtensorModule::add_balance_to_coldkey_account(&delegate_coldkey, owner_stake);
17911763
assert_ok!(SubtensorModule::add_stake(

pallets/subtensor/src/tests/swap_coldkey.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ fn test_swap_total_coldkey_stake() {
107107
SubtensorModule::add_balance_to_coldkey_account(&old_coldkey, stake * 2 + 1_000);
108108
register_ok_neuron(netuid, hotkey, old_coldkey, 1001000);
109109
register_ok_neuron(netuid, other_hotkey, other_coldkey, 1001000);
110-
// make delegate
111-
assert_ok!(SubtensorModule::become_delegate(
112-
<<Test as Config>::RuntimeOrigin>::signed(other_coldkey),
113-
other_hotkey
114-
));
115110

116111
assert_ok!(SubtensorModule::add_stake(
117112
<<Test as Config>::RuntimeOrigin>::signed(old_coldkey),
@@ -380,11 +375,7 @@ fn test_swap_with_max_values() {
380375
// hotkey2 is owned by other_coldkey.
381376
register_ok_neuron(netuid, hotkey, old_coldkey, 1001000);
382377
register_ok_neuron(netuid2, hotkey2, other_coldkey, 1001000);
383-
// Make hotkey2 a delegate.
384-
assert_ok!(SubtensorModule::become_delegate(
385-
<<Test as Config>::RuntimeOrigin>::signed(other_coldkey),
386-
hotkey2
387-
));
378+
388379
// Give balance to old_coldkey and old_coldkey2.
389380
SubtensorModule::add_balance_to_coldkey_account(&old_coldkey, max_stake + 1_000);
390381
SubtensorModule::add_balance_to_coldkey_account(&old_coldkey2, max_stake + 1_000);
@@ -978,11 +969,6 @@ fn test_swap_staking_hotkeys_for_coldkey() {
978969
// Register hotkeys
979970
register_ok_neuron(netuid, hotkey1, old_coldkey, 0);
980971
register_ok_neuron(netuid, hotkey2, other_coldkey, 0);
981-
// Make hotkey2 a delegate
982-
assert_ok!(SubtensorModule::become_delegate(
983-
<<Test as Config>::RuntimeOrigin>::signed(other_coldkey),
984-
hotkey2
985-
));
986972

987973
// Stake to hotkeys
988974
assert_ok!(SubtensorModule::add_stake(
@@ -1046,14 +1032,6 @@ fn test_swap_delegated_stake_for_coldkey() {
10461032
add_network(netuid, 1, 0);
10471033
register_ok_neuron(netuid, hotkey1, other_coldkey, 0);
10481034
register_ok_neuron(netuid, hotkey2, other_coldkey, 0);
1049-
assert_ok!(SubtensorModule::become_delegate(
1050-
<<Test as Config>::RuntimeOrigin>::signed(other_coldkey),
1051-
hotkey1
1052-
));
1053-
assert_ok!(SubtensorModule::become_delegate(
1054-
<<Test as Config>::RuntimeOrigin>::signed(other_coldkey),
1055-
hotkey2
1056-
));
10571035

10581036
// Notice hotkey1 and hotkey2 are Owned by other_coldkey
10591037
// old_coldkey and new_coldkey therefore delegates stake to them

0 commit comments

Comments
 (0)