Allow "anonymous" proxied accounts (#6236)

* Anonymous proxiers

* More testing

* More testing

* Build fix

* Build fix

* Benchmarks.

* fix benchmarking

* add weights

* fix line width

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Gavin Wood
2020-06-06 10:55:52 +02:00
committed by GitHub
parent d2846e2b9a
commit 0761a8e0c3
7 changed files with 218 additions and 29 deletions
+15
View File
@@ -47,10 +47,25 @@ impl<T> Filter<T> for () {
pub trait InstanceFilter<T> {
/// Determine if a given value should be allowed through the filter (returns `true`) or not.
fn filter(&self, _: &T) -> bool;
/// Determines whether `self` matches at least all items that `o` does.
fn is_no_less_permissive(&self, o: &Self) -> bool { !self.is_less_permissive(o) }
/// Determines whether `self` matches at most only the items that `o` does.
fn is_no_more_permissive(&self, o: &Self) -> bool { !o.is_less_permissive(&self) }
/// Determines whether `self` matches all the items that `o` does and others.
fn is_more_permissive(&self, o: &Self) -> bool { o.is_less_permissive(self) }
/// Determines whether `self` does not match all the items that `_o` does, nor any others.
///
/// NOTE: This is the only `*permissive` function that needs to be reimplemented.
fn is_less_permissive(&self, _o: &Self) -> bool { true }
}
impl<T> InstanceFilter<T> for () {
fn filter(&self, _: &T) -> bool { true }
fn is_less_permissive(&self, _o: &Self) -> bool { false }
}
/// An abstraction of a value stored within storage, but possibly as part of a larger composite