mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 07:41:08 +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:
@@ -53,9 +53,10 @@ use frame_support::{
|
||||
DispatchError, DispatchResult, DispatchResultWithPostInfo, Dispatchable, GetDispatchInfo,
|
||||
Pays, PostDispatchInfo,
|
||||
},
|
||||
ensure,
|
||||
ensure, impl_ensure_origin_with_arg_ignoring_arg,
|
||||
traits::{
|
||||
Backing, ChangeMembers, EnsureOrigin, Get, GetBacking, InitializeMembers, StorageVersion,
|
||||
Backing, ChangeMembers, EnsureOrigin, EnsureOriginWithArg, Get, GetBacking,
|
||||
InitializeMembers, StorageVersion,
|
||||
},
|
||||
weights::Weight,
|
||||
};
|
||||
@@ -1154,6 +1155,12 @@ impl<
|
||||
}
|
||||
}
|
||||
|
||||
impl_ensure_origin_with_arg_ignoring_arg! {
|
||||
impl< { O: .., I: 'static, AccountId: Decode, T } >
|
||||
EnsureOriginWithArg<O, T> for EnsureMember<AccountId, I>
|
||||
{}
|
||||
}
|
||||
|
||||
pub struct EnsureMembers<AccountId, I: 'static, const N: u32>(PhantomData<(AccountId, I)>);
|
||||
impl<
|
||||
O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>,
|
||||
@@ -1176,6 +1183,12 @@ impl<
|
||||
}
|
||||
}
|
||||
|
||||
impl_ensure_origin_with_arg_ignoring_arg! {
|
||||
impl< { O: .., I: 'static, const N: u32, AccountId, T } >
|
||||
EnsureOriginWithArg<O, T> for EnsureMembers<AccountId, I, N>
|
||||
{}
|
||||
}
|
||||
|
||||
pub struct EnsureProportionMoreThan<AccountId, I: 'static, const N: u32, const D: u32>(
|
||||
PhantomData<(AccountId, I)>,
|
||||
);
|
||||
@@ -1201,6 +1214,12 @@ impl<
|
||||
}
|
||||
}
|
||||
|
||||
impl_ensure_origin_with_arg_ignoring_arg! {
|
||||
impl< { O: .., I: 'static, const N: u32, const D: u32, AccountId, T } >
|
||||
EnsureOriginWithArg<O, T> for EnsureProportionMoreThan<AccountId, I, N, D>
|
||||
{}
|
||||
}
|
||||
|
||||
pub struct EnsureProportionAtLeast<AccountId, I: 'static, const N: u32, const D: u32>(
|
||||
PhantomData<(AccountId, I)>,
|
||||
);
|
||||
@@ -1225,3 +1244,9 @@ impl<
|
||||
Ok(O::from(RawOrigin::Members(0u32, 0u32)))
|
||||
}
|
||||
}
|
||||
|
||||
impl_ensure_origin_with_arg_ignoring_arg! {
|
||||
impl< { O: .., I: 'static, const N: u32, const D: u32, AccountId, T } >
|
||||
EnsureOriginWithArg<O, T> for EnsureProportionAtLeast<AccountId, I, N, D>
|
||||
{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user