mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 11:41:04 +00:00
Backing/GetBacking: Abstraction over pluralistic origins for XCM. (#8579)
* Backing/GetBacking: Abstraction over pluralistic origins for XCM. * Update frame/support/src/traits/misc.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/support/src/traits/misc.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -55,7 +55,7 @@ use frame_support::{
|
||||
PostDispatchInfo,
|
||||
},
|
||||
ensure,
|
||||
traits::{ChangeMembers, EnsureOrigin, Get, InitializeMembers},
|
||||
traits::{ChangeMembers, EnsureOrigin, Get, InitializeMembers, GetBacking, Backing},
|
||||
weights::{DispatchClass, GetDispatchInfo, Weight, Pays},
|
||||
};
|
||||
use frame_system::{self as system, ensure_signed, ensure_root};
|
||||
@@ -165,6 +165,15 @@ pub enum RawOrigin<AccountId, I> {
|
||||
_Phantom(sp_std::marker::PhantomData<I>),
|
||||
}
|
||||
|
||||
impl<AccountId, I> GetBacking for RawOrigin<AccountId, I> {
|
||||
fn get_backing(&self) -> Option<Backing> {
|
||||
match self {
|
||||
RawOrigin::Members(n, d) => Some(Backing { approvals: *n, eligible: *d }),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Origin for the collective module.
|
||||
pub type Origin<T, I=DefaultInstance> = RawOrigin<<T as frame_system::Config>::AccountId, I>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user