Allow construct_runtime to take cfg attributes for pallets#11818
Allow construct_runtime to take cfg attributes for pallets#11818paritytech-processbot[bot] merged 15 commits intomasterfrom
Conversation
|
wen |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
cc @sam0x17 |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
sam0x17
left a comment
There was a problem hiding this comment.
This makes sense to me and is a very reasonable improvement. I found some missing end-of-file newlines on a few files that would be cool to fix but other than that this looks good--macro code is well structured.
frame/support/test/tests/construct_runtime_ui/unsupported_pallet_attr.rs
Outdated
Show resolved
Hide resolved
frame/support/test/tests/construct_runtime_ui/unsupported_meta_structure.rs
Outdated
Show resolved
Hide resolved
frame/support/test/tests/construct_runtime_ui/invalid_meta_literal.rs
Outdated
Show resolved
Hide resolved
shawntabrizi
left a comment
There was a problem hiding this comment.
high level, non-expert macro review
|
bot merge |
…h#11818) * Allow construct_runtime to take cfg attributes for pallets * cargo fmt * Remove commented out code * Fixes * cargo fmt * Remove inaccurate comments * Fix typo * Properly reverse pallets * Fixes * cargo fmt * Add missing newlines
Fixes #10286.
This PR allows
#[cfg]attributes to exist on top of pallet declarations in theconstruct_runtime!macro, and it works exactly in the way that you would intuitively expect -- the pallet immediately following the attribute would exist in the runtime only if the feature gate as described by thecfgattribute is enabled, otherwise it does not exist.