mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 08:21:03 +00:00
SystemOrigin trait (#7226)
* SystemOrigin trait * OriginTrait provides AccountId * Use new trait definition * Consolidate trait Co-authored-by: Gav Wood <gavin@parity.io> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -1621,6 +1621,9 @@ pub trait OriginTrait: Sized {
|
||||
/// The caller origin, overarching type of all pallets origins.
|
||||
type PalletsOrigin;
|
||||
|
||||
/// The AccountId used across the system.
|
||||
type AccountId;
|
||||
|
||||
/// Add a filter to the origin.
|
||||
fn add_filter(&mut self, filter: impl Fn(&Self::Call) -> bool + 'static);
|
||||
|
||||
@@ -1635,6 +1638,15 @@ pub trait OriginTrait: Sized {
|
||||
|
||||
/// Get the caller.
|
||||
fn caller(&self) -> &Self::PalletsOrigin;
|
||||
|
||||
/// Create with system none origin and `frame-system::Trait::BaseCallFilter`.
|
||||
fn none() -> Self;
|
||||
|
||||
/// Create with system root origin and no filter.
|
||||
fn root() -> Self;
|
||||
|
||||
/// Create with system signed origin and `frame-system::Trait::BaseCallFilter`.
|
||||
fn signed(by: Self::AccountId) -> Self;
|
||||
}
|
||||
|
||||
/// Trait to be used when types are exactly same.
|
||||
|
||||
Reference in New Issue
Block a user