Junius/fix scheduled coldkey swap back unit test#707
Conversation
distributedstatemachine
left a comment
There was a problem hiding this comment.
Please see comments
| .saturating_add(T::DbWeight::get().writes(527)), DispatchClass::Operational, Pays::No))] | ||
| pub fn swap_coldkey( | ||
| origin: OriginFor<T>, | ||
| old_coldkey: T::AccountId, |
There was a problem hiding this comment.
Why are you changing the signature of the the swap_coldkey function ? Does the scheduler require it ?
There was a problem hiding this comment.
I think the extrinsic is just for root. we can't get the old_coldkey from Origin. No Origin can be both root and signed.
There was a problem hiding this comment.
It is not related to scheduler.
There was a problem hiding this comment.
makes sense, and the scheduler has root origin ? Just want to be 100% sure only root or the scheduler can call it
There was a problem hiding this comment.
scheduler just accepts the call and trigger it later. scheduler not attach any origin. the root origin is from schedule_swap_coldkey function, subtensor pallet use frame_system::RawOrigin::Root.into() as origin.
T::Scheduler::schedule(
DispatchTime::At(when),
None,
63,
frame_system::RawOrigin::Root.into(),
bound_call,
)
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.