Remove Filter and use Contains instead (#9514)

* Remove Filter and use Contains instead

* Fixes

* Formatting

* Update docs/Upgrading-2.0-to-3.0.md

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Typo

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Gavin Wood
2021-08-07 21:26:40 +02:00
committed by GitHub
parent e251d1cedb
commit bdda3ed612
79 changed files with 199 additions and 199 deletions
+4 -4
View File
@@ -33,7 +33,7 @@ use frame_support::{
dispatch::DispatchErrorWithPostInfo,
parameter_types,
storage::child,
traits::{Currency, Filter, OnInitialize, ReservableCurrency},
traits::{Contains, Currency, OnInitialize, ReservableCurrency},
weights::{constants::WEIGHT_PER_SECOND, DispatchClass, PostDispatchInfo, Weight},
};
use frame_system::{self as system, EventRecord, Phase};
@@ -197,7 +197,7 @@ parameter_types! {
pub static ExistentialDeposit: u64 = 0;
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::AllowAll;
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = BlockWeights;
type BlockLength = ();
type DbWeight = ();
@@ -282,8 +282,8 @@ impl TestFilter {
}
}
impl Filter<Call> for TestFilter {
fn filter(call: &Call) -> bool {
impl Contains<Call> for TestFilter {
fn contains(call: &Call) -> bool {
CALL_FILTER.with(|fltr| fltr.borrow()(call))
}
}