-
Notifications
You must be signed in to change notification settings - Fork 295
authorize root call #603
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
authorize root call #603
Conversation
Codecov Report
@@ Coverage Diff @@
## master #603 +/- ##
==========================================
+ Coverage 75.58% 75.86% +0.27%
==========================================
Files 76 76
Lines 5955 6123 +168
==========================================
+ Hits 4501 4645 +144
- Misses 1454 1478 +24
Continue to review full report at Codecov.
|
xlc
left a comment
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.
just need a way to cancel saved call and should be good
xlc
left a comment
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.
Need benchmarking & weights and should be good.
| if let Some(caller) = maybe_caller { | ||
| ensure!(who == caller, Error::<T>::TriggerCallNotPermitted); | ||
| } | ||
| let result = call.dispatch(OriginFor::<T>::root()); |
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.
you skip weighing the call
you'll probably want to pass a weight as param and then ensure that the executed call has lower or equal weight to it
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.
you skip weighing the call
you'll probably want to pass a weight as param and then ensure that the executed call has lower or equal weight to it
pushed an update to handle call post_info
authority/src/lib.rs
Outdated
| }) | ||
| } | ||
|
|
||
| #[pallet::weight(T::WeightInfo::trigger_call())] |
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.
Needs to include the weight of the call. Add new #[pallet::compact] weight_bound: Weight and add it to the weight, and then ensure the call weight is lte the weight bound.
Something similar to this
https://github.com/paritytech/substrate/blob/ce1746ddf6588c8f9ecfb77411c3cac7a2c09db3/frame/collective/src/lib.rs#L662
Closes #602