-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require explicit pallet indexes #821
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orriin
previously approved these changes
Sep 19, 2024
keithtensor
reviewed
Sep 19, 2024
keithtensor
reviewed
Sep 19, 2024
keithtensor
reviewed
Sep 19, 2024
JohnReedV
previously approved these changes
Sep 20, 2024
orriin
previously approved these changes
Sep 20, 2024
gztensor
previously approved these changes
Sep 20, 2024
had to turn off |
gztensor
approved these changes
Sep 23, 2024
orriin
approved these changes
Sep 23, 2024
unconst
approved these changes
Sep 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #787
also fixes CI bug that was causing custom lint check to not catch lint failures
Adds a custom lint that completely disallows invocations of
construct_runtime!
that do not use explicit indexes for all mentioned pallets.This was extremely tricky to get right. After many attempts to re-implement
construct_runtime!
parsing from scratch, I decided to forkframe-support-procedural
from upstream and modify it so that instead of a proc-macro crate, it exports all parsing logic so it can be used from other crates. This can be fully updated to whatever tag we want inpolkadot-sdk
using the providedupdate.sh
script by modifying this line:POLKADOT_SDK_TAG="v1.10.0-rc3"
If polkadot-sdk ever adds a public way of accessing the parsing logic for frame internals, we can remove this fork, however that is unlikely to happen any time soon. Maintaining this fork should be super easy since it can be updated with the script whenever we want, and the structure of that crate is likely never going to change (I used to maintain it).
Notes for Reviewers / TLDR:
procedural-fork
OTHER THAN thelib.rs
,update.sh
andCargo.toml
are copied verbatim frompolkadot-sdk
1.10., so those 3 files are all you need to review from that directorysupport/linting/pallet_index.rs
andbuild.rs