-
Notifications
You must be signed in to change notification settings - Fork 824
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
Fixes #219 #7407
Fixes #219 #7407
Conversation
Signed-off-by: Xavier Lau <x@acg.box>
c6b8a3b
to
98ccdc1
Compare
substrate/frame/utility/src/lib.rs
Outdated
@@ -454,6 +454,36 @@ pub mod pallet { | |||
let res = call.dispatch_bypass_filter(frame_system::RawOrigin::Root.into()); | |||
res.map(|_| ()).map_err(|e| e.error) | |||
} | |||
|
|||
/// Dispatches a function call with a provided origin. | |||
/// Almost the same as [`Pallet::dispatch_as`] but check the result of the 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.
Maybe we can be more explicit and say it will return an error if the call returns an error.
I find the verb "check" a bit vague here.
substrate/frame/utility/src/lib.rs
Outdated
dispatch_info.class, | ||
) | ||
})] | ||
pub fn dispatch_as_checked( |
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.
pub fn dispatch_as_checked( | |
pub fn dispatch_as_fallible( |
Maybe that sounds better?
Co-authored-by: Bastian Köcher <git@kchr.de>
@aurexav will you finish this? |
…adot-sdk into dispatch-as-checked
Done. Quite busy these days and forgot about this. |
It will also need a PRdoc |
Updated the desc. Does |
/cmd prdoc --audience runtime_dev,runtime_user --bump minor |
Command "" has started 🚀 See logs here |
Command "" has finished ✅ See logs here |
it doesn't seem to work, the patch from the job is empty. |
/cmd prdoc --audience runtime_dev --bump minor |
/cmd fmt |
1ac2e96
Add a new extrinsic `dispatch_as_fallible`. It's almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call. Closes paritytech#219. And add more unit tests to cover `dispatch_as` and `dispatch_as_fallible`. --- Polkadot address: 156HGo9setPcU2qhFMVWLkcmtCEGySLwNqa3DaEiYSWtte4Y --------- Signed-off-by: Xavier Lau <x@acg.box> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Bastian Köcher <info@kchr.de> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Add a new extrinsic
dispatch_as_fallible
.It's almost the same as [
Pallet::dispatch_as
] but forwards any error of the inner call.Closes #219.
And add more unit tests to cover
dispatch_as
anddispatch_as_fallible
.Polkadot address: 156HGo9setPcU2qhFMVWLkcmtCEGySLwNqa3DaEiYSWtte4Y