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
@@ -24,7 +24,7 @@ use super::*;
use std::cell::RefCell;
use frame_support::{
assert_noop, assert_ok, parameter_types,
weights::Weight, traits::Contains,
weights::Weight, traits::SortedMembers,
PalletId
};
use sp_runtime::Permill;
@@ -98,7 +98,7 @@ thread_local! {
static TEN_TO_FOURTEEN: RefCell<Vec<u128>> = RefCell::new(vec![10,11,12,13,14]);
}
pub struct TenToFourteen;
impl Contains<u128> for TenToFourteen {
impl SortedMembers<u128> for TenToFourteen {
fn sorted_members() -> Vec<u128> {
TEN_TO_FOURTEEN.with(|v| {
v.borrow().clone()