Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fixes #219 #7407

wants to merge 3 commits into from

Conversation

aurexav
Copy link
Contributor

@aurexav aurexav commented Jan 31, 2025

Add a new extrinsic dispatch_as_checked.

It's almost the same as dispatch_as but check the result of the call.

Closes #219.

And add more unit tests to cover dispatch_as and dispatch_as_checked.


Polkadot address: 156HGo9setPcU2qhFMVWLkcmtCEGySLwNqa3DaEiYSWtte4Y

@aurexav aurexav requested a review from a team as a code owner January 31, 2025 10:55
@aurexav aurexav force-pushed the dispatch-as-checked branch from c6b8a3b to 98ccdc1 Compare January 31, 2025 11:32
@@ -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.
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

utility.dispatch_as error handling
2 participants