Filter calls in utility (#6131)

* Filter calls.

* Remove old proxy code

* Docs and repot

* Update frame/utility/src/tests.rs

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>

* fix test

* Grumble

* Bump runtime version

* fix

* Attempt general fix

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
Co-authored-by: NikVolf <nikvolf@gmail.com>
This commit is contained in:
Gavin Wood
2020-05-26 06:34:25 +02:00
committed by GitHub
parent 110cc85715
commit 42ad0d138f
11 changed files with 92 additions and 17 deletions
+10
View File
@@ -33,6 +33,16 @@ use crate::storage::StorageMap;
use crate::weights::Weight;
use impl_trait_for_tuples::impl_for_tuples;
/// Simple trait for providing a filter over a reference to some type.
pub trait Filter<T> {
/// Determine if a given value should be allowed through the filter (returns `true`) or not.
fn filter(_: &T) -> bool;
}
impl<T> Filter<T> for () {
fn filter(_: &T) -> bool { true }
}
/// An abstraction of a value stored within storage, but possibly as part of a larger composite
/// item.
pub trait StoredMap<K, T> {