mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 22:27:56 +00:00
Move EnsureOneOf into the dispatch.rs, make an interface more general (#10379)
* move EnsureOneOf into the dispatch.rs, make an interface more general * Update frame/support/src/traits/dispatch.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -26,7 +26,7 @@ use codec::{Decode, Encode, MaxEncodedLen};
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
traits::{
|
||||
ConstU32, Currency, EqualPrivilegeOnly, Everything, Imbalance, InstanceFilter,
|
||||
ConstU32, Currency, EnsureOneOf, EqualPrivilegeOnly, Everything, Imbalance, InstanceFilter,
|
||||
KeyOwnerProofSystem, LockIdentifier, Nothing, OnUnbalanced, U128CurrencyToVote,
|
||||
},
|
||||
weights::{
|
||||
@@ -37,7 +37,7 @@ use frame_support::{
|
||||
};
|
||||
use frame_system::{
|
||||
limits::{BlockLength, BlockWeights},
|
||||
EnsureOneOf, EnsureRoot,
|
||||
EnsureRoot,
|
||||
};
|
||||
pub use node_primitives::{AccountId, Signature};
|
||||
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Index, Moment};
|
||||
@@ -535,7 +535,6 @@ impl pallet_staking::Config for Runtime {
|
||||
type SlashDeferDuration = SlashDeferDuration;
|
||||
/// A super-majority of the council can cancel the slash.
|
||||
type SlashCancelOrigin = EnsureOneOf<
|
||||
AccountId,
|
||||
EnsureRoot<AccountId>,
|
||||
pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>,
|
||||
>;
|
||||
@@ -726,7 +725,6 @@ impl pallet_democracy::Config for Runtime {
|
||||
// To cancel a proposal before it has been passed, the technical committee must be unanimous or
|
||||
// Root must agree.
|
||||
type CancelProposalOrigin = EnsureOneOf<
|
||||
AccountId,
|
||||
EnsureRoot<AccountId>,
|
||||
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>,
|
||||
>;
|
||||
@@ -817,7 +815,6 @@ impl pallet_collective::Config<TechnicalCollective> for Runtime {
|
||||
}
|
||||
|
||||
type EnsureRootOrHalfCouncil = EnsureOneOf<
|
||||
AccountId,
|
||||
EnsureRoot<AccountId>,
|
||||
pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>,
|
||||
>;
|
||||
@@ -857,12 +854,10 @@ impl pallet_treasury::Config for Runtime {
|
||||
type PalletId = TreasuryPalletId;
|
||||
type Currency = Balances;
|
||||
type ApproveOrigin = EnsureOneOf<
|
||||
AccountId,
|
||||
EnsureRoot<AccountId>,
|
||||
pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>,
|
||||
>;
|
||||
type RejectOrigin = EnsureOneOf<
|
||||
AccountId,
|
||||
EnsureRoot<AccountId>,
|
||||
pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>,
|
||||
>;
|
||||
|
||||
Reference in New Issue
Block a user