mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
Frame: Give Referendum SubmitOrigin argument (#14326)
* Referedum's SubmitOrigin should have an arg * Fixes * Nits and two extra utils * Fixes * Fixes
This commit is contained in:
@@ -89,6 +89,26 @@ impl<AccountId> From<Option<AccountId>> for RawOrigin<AccountId> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<AccountId> RawOrigin<AccountId> {
|
||||
/// Returns `Some` with a reference to the `AccountId` if `self` is `Signed`, `None` otherwise.
|
||||
pub fn as_signed(&self) -> Option<&AccountId> {
|
||||
match &self {
|
||||
Self::Signed(x) => Some(x),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if `self` is `Root`, `None` otherwise.
|
||||
pub fn is_root(&self) -> bool {
|
||||
matches!(&self, Self::Root)
|
||||
}
|
||||
|
||||
/// Returns `true` if `self` is `None`, `None` otherwise.
|
||||
pub fn is_none(&self) -> bool {
|
||||
matches!(&self, Self::None)
|
||||
}
|
||||
}
|
||||
|
||||
/// A type that can be used as a parameter in a dispatchable function.
|
||||
///
|
||||
/// When using `decl_module` all arguments for call functions must implement this trait.
|
||||
|
||||
Reference in New Issue
Block a user