Allow lossless matching for Origin (#8576)

* Allow lossless matching for Origin

Without these changes, it's difficult/impossible to not lose any filters
when making fine-grained matches against origin.

* whilespace

* Apply suggestions from code review

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Gavin Wood
2021-04-08 20:06:09 +02:00
committed by GitHub
parent d440ef322b
commit f935dfc1a1
2 changed files with 46 additions and 0 deletions
@@ -76,6 +76,12 @@ pub trait OriginTrait: Sized {
/// Get the caller.
fn caller(&self) -> &Self::PalletsOrigin;
/// Do something with the caller, consuming self but returning it if the caller was unused.
fn try_with_caller<R>(
self,
f: impl FnOnce(Self::PalletsOrigin) -> Result<R, Self::PalletsOrigin>,
) -> Result<R, Self>;
/// Create with system none origin and `frame-system::Config::BaseCallFilter`.
fn none() -> Self;