-
Notifications
You must be signed in to change notification settings - Fork 167
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
add sudo call to set duration for schedule call #745
Conversation
@@ -992,9 +992,8 @@ impl<T: Config> Pallet<T> { | |||
/// * 'SubNetworkDoesNotExist': If the specified network does not exist. | |||
/// * 'NotSubnetOwner': If the caller does not own the specified subnet. | |||
/// | |||
pub fn user_remove_network(origin: T::RuntimeOrigin, netuid: u16) -> dispatch::DispatchResult { | |||
pub fn user_remove_network(coldkey: T::AccountId, netuid: u16) -> dispatch::DispatchResult { | |||
// --- 1. Ensure the function caller is a signed user. |
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.
fix comments
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.
will fix it.
@@ -1100,7 +1105,10 @@ mod dispatches { | |||
let duration: BlockNumberFor<T> = DissolveNetworkScheduleDuration::<T>::get(); | |||
let when: BlockNumberFor<T> = current_block.saturating_add(duration); | |||
|
|||
let call = Call::<T>::dissolve_network { netuid }; | |||
let call = Call::<T>::dissolve_network { |
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.
Do we need to check that the user owns the network they are trying to dissolve here ? From the looks of it , anyone can dissolve a network , so I think we should just check if the user is the owner of the network
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.
The owner could be updated after the call scheduled. You can check my test case. We could let the dissolve_network extrinsic to check when it is executed.
@@ -681,7 +681,7 @@ mod dispatches { | |||
new_coldkey: T::AccountId, | |||
) -> DispatchResultWithPostInfo { | |||
// Ensure it's called with root privileges (scheduler has root privileges) | |||
ensure_root(origin.clone())?; | |||
ensure_root(origin)?; |
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.
nevermind , the check is the method
b4c1712
Description
Related Issue(s)
Type of Change
Breaking Change
If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.
Checklist
cargo fmt
andcargo clippy
to ensure my code is formatted and linted correctlyScreenshots (if applicable)
Please include any relevant screenshots or GIFs that demonstrate the changes made.
Additional Notes
Please provide any additional information or context that may be helpful for reviewers.