Purify Contains, add IsInVec, All and SortedMembers (#8589)

* IsInVec

* Purify `Contains`, introduce SortedMembers
This commit is contained in:
Gavin Wood
2021-04-11 00:04:02 +02:00
committed by GitHub
parent fe775ab954
commit 29864b255c
9 changed files with 60 additions and 15 deletions
+2 -2
View File
@@ -87,7 +87,7 @@ use sp_core::{ChangesTrieConfiguration, storage::well_known_keys};
use frame_support::{
Parameter, storage,
traits::{
Contains, Get, PalletInfo, OnNewAccount, OnKilledAccount, HandleLifetime,
SortedMembers, Get, PalletInfo, OnNewAccount, OnKilledAccount, HandleLifetime,
StoredMap, EnsureOrigin, OriginTrait, Filter,
},
weights::{
@@ -870,7 +870,7 @@ impl<
pub struct EnsureSignedBy<Who, AccountId>(sp_std::marker::PhantomData<(Who, AccountId)>);
impl<
O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>,
Who: Contains<AccountId>,
Who: SortedMembers<AccountId>,
AccountId: PartialEq + Clone + Ord + Default,
> EnsureOrigin<O> for EnsureSignedBy<Who, AccountId> {
type Success = AccountId;