Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Remove Filter and use Contains instead #9514

Merged
5 commits merged into from
Aug 7, 2021
Merged

Conversation

gavofyork
Copy link
Member

@gavofyork gavofyork commented Aug 7, 2021

Part of paritytech/polkadot#2841
Companion: paritytech/polkadot#3591

Filter and Contains do exactly the same thing, but are used in slightly different contexts. This just merges them, allowing some utilities written for Contains to be used where Filter was in use.

Migration

Items within frame_support::traits:

  • Usage of Filter should be replaced with Contains.
  • Usage of Filter::filter() should be replaced with Contains::contains(). This includes derivative usage within the inheriting trait FilterStack.
  • Usage of All<...> should be replaced with Everything (NOTE: The type agument should be dropped).
  • Usage of AllowAll should be replaced with Everything
  • Usage of DenyAll should be replaced with Nothing

@gavofyork gavofyork added A0-please_review Pull request needs code review. B3-apinoteworthy C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Aug 7, 2021
Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
frame/staking/README.md Outdated Show resolved Hide resolved
@gavofyork
Copy link
Member Author

bot merge

@ghost
Copy link

ghost commented Aug 7, 2021

Trying merge.

@ghost ghost merged commit 9d867b6 into master Aug 7, 2021
@ghost ghost deleted the gav-filter-becomes-contains branch August 7, 2021 19:26
liuchengxu pushed a commit to canyon-network/substrate that referenced this pull request Aug 8, 2021
* 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>

Expose BabeVerifier
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants