-
Notifications
You must be signed in to change notification settings - Fork 244
Remove Duplicate HP setter #2114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devnet-ready
Are you sure you want to change the base?
Changes from 6 commits
2fec8d7
13ddea7
01f2000
de04830
aa72439
ca6aad7
ba6899b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -1745,48 +1745,48 @@ fn test_sets_a_lower_value_clears_small_nominations() { | |||
}); | ||||
} | ||||
|
||||
#[test] | ||||
fn test_sudo_set_subnet_owner_hotkey() { | ||||
new_test_ext().execute_with(|| { | ||||
let netuid = NetUid::from(1); | ||||
|
||||
let coldkey: U256 = U256::from(1); | ||||
let hotkey: U256 = U256::from(2); | ||||
let new_hotkey: U256 = U256::from(3); | ||||
|
||||
let coldkey_origin = <<Test as Config>::RuntimeOrigin>::signed(coldkey); | ||||
let root = RuntimeOrigin::root(); | ||||
let random_account = RuntimeOrigin::signed(U256::from(123456)); | ||||
|
||||
pallet_subtensor::SubnetOwner::<Test>::insert(netuid, coldkey); | ||||
pallet_subtensor::SubnetOwnerHotkey::<Test>::insert(netuid, hotkey); | ||||
assert_eq!( | ||||
pallet_subtensor::SubnetOwnerHotkey::<Test>::get(netuid), | ||||
hotkey | ||||
); | ||||
|
||||
assert_ok!(AdminUtils::sudo_set_subnet_owner_hotkey( | ||||
coldkey_origin, | ||||
netuid, | ||||
new_hotkey | ||||
)); | ||||
|
||||
assert_eq!( | ||||
pallet_subtensor::SubnetOwnerHotkey::<Test>::get(netuid), | ||||
new_hotkey | ||||
); | ||||
|
||||
assert_noop!( | ||||
AdminUtils::sudo_set_subnet_owner_hotkey(random_account, netuid, new_hotkey), | ||||
DispatchError::BadOrigin | ||||
); | ||||
|
||||
assert_noop!( | ||||
AdminUtils::sudo_set_subnet_owner_hotkey(root, netuid, new_hotkey), | ||||
DispatchError::BadOrigin | ||||
); | ||||
}); | ||||
} | ||||
// #[test] | ||||
// fn test_sudo_set_subnet_owner_hotkey() { | ||||
// new_test_ext().execute_with(|| { | ||||
// let netuid = NetUid::from(1); | ||||
|
||||
// let coldkey: U256 = U256::from(1); | ||||
// let hotkey: U256 = U256::from(2); | ||||
// let new_hotkey: U256 = U256::from(3); | ||||
|
||||
// let coldkey_origin = <<Test as Config>::RuntimeOrigin>::signed(coldkey); | ||||
// let root = RuntimeOrigin::root(); | ||||
// let random_account = RuntimeOrigin::signed(U256::from(123456)); | ||||
|
||||
// pallet_subtensor::SubnetOwner::<Test>::insert(netuid, coldkey); | ||||
// pallet_subtensor::SubnetOwnerHotkey::<Test>::insert(netuid, hotkey); | ||||
// assert_eq!( | ||||
// pallet_subtensor::SubnetOwnerHotkey::<Test>::get(netuid), | ||||
// hotkey | ||||
// ); | ||||
|
||||
// assert_ok!(AdminUtils::sudo_set_subnet_owner_hotkey( | ||||
// coldkey_origin, | ||||
// netuid, | ||||
// new_hotkey | ||||
// )); | ||||
|
||||
// assert_eq!( | ||||
// pallet_subtensor::SubnetOwnerHotkey::<Test>::get(netuid), | ||||
// new_hotkey | ||||
// ); | ||||
|
||||
// assert_noop!( | ||||
// AdminUtils::sudo_set_subnet_owner_hotkey(random_account, netuid, new_hotkey), | ||||
// DispatchError::BadOrigin | ||||
// ); | ||||
|
||||
// assert_noop!( | ||||
// AdminUtils::sudo_set_subnet_owner_hotkey(root, netuid, new_hotkey), | ||||
// DispatchError::BadOrigin | ||||
// ); | ||||
// }); | ||||
// } | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Trust VCS. If you'll ever need this code back, it will be in the repo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I commented it out instead of deleting it to make it more difficult for somebody to re-use the extrinsic index. Substrate doesn't like that. |
||||
|
||||
// cargo test --package pallet-admin-utils --lib -- tests::test_sudo_set_ema_halving --exact --show-output | ||||
#[test] | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another function that does the same thing in the same file, one has "sn" in the name and the other has "subnet". Do we need both? What for?
I'm not sure which one Cortex uses, I'd keep that one and remove the other one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cortex uses neither at the moment.