add sudo call to set duration for schedule call#745
Merged
unconst merged 8 commits intodevnet-readyfrom Aug 23, 2024
Merged
Conversation
sam0x17
previously approved these changes
Aug 20, 2024
sam0x17
previously approved these changes
Aug 20, 2024
sam0x17
previously approved these changes
Aug 21, 2024
distributedstatemachine
previously approved these changes
Aug 23, 2024
| /// | ||
| 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. |
Collaborator
There was a problem hiding this comment.
fix comments
| let when: BlockNumberFor<T> = current_block.saturating_add(duration); | ||
|
|
||
| let call = Call::<T>::dissolve_network { netuid }; | ||
| let call = Call::<T>::dissolve_network { |
Collaborator
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
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.
| ) -> DispatchResultWithPostInfo { | ||
| // Ensure it's called with root privileges (scheduler has root privileges) | ||
| ensure_root(origin.clone())?; | ||
| ensure_root(origin)?; |
Collaborator
There was a problem hiding this comment.
nevermind , the check is the method
b4c1712
unconst
approved these changes
Aug 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fmtandcargo clippyto 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.