This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Metadata V15: Expose types for the overarching Call, Event, Error enums #14143
Merged
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
ac824b1
frame-metadata: Point to unreleased branch
lexnv e9c2fd3
frame: Generalize outer enum generation for events and errors
lexnv 6707973
frame: Remove individual generation of outer enum events
lexnv a41c847
primitives/traits: Add marker trait for outer runtime enums
lexnv a04007f
frame: Derive Clone, PartialEq, Eq for RuntimeEvents only
lexnv cb6309f
frame/pallet: Include `#[pallet::error]` enum into pallet parts
lexnv cf0e3e2
metadata-ir: Include call, event, error types
lexnv 8638fbb
frame/metadata: Include outer enum types in V15 metadata
lexnv 6d9af4b
frame/tests: Ensure `RuntimeError` includes `#[pallet::error]` parts
lexnv eca5422
frame/support: Document the reserved name for `RuntimeError`
lexnv ca130b3
frame: Use self-generated `RuntimeEvent` for `GetRuntimeOuterEnumTypes`
lexnv b004ae3
frame/ui: Fix UI tests
lexnv 1e00fed
frame/support: Remove unused system path
lexnv 42b7d98
frame/ui: Unexpected field and reintroduce frame_system::Config for R…
lexnv 85c5aeb
frame/support: Remove `GetRuntimeOuterEnumTypes` marker trait
lexnv f65172d
frame/support: Remove `;` from macro
lexnv 8ac30ba
Update frame-metadata to point to unreleased branch
lexnv 9849d4b
Rename error_enum_ty to module_error_enum_ty
lexnv 7228348
Merge remote-tracking branch 'origin/master' into lexnv/metadata_oute…
lexnv e7b9829
Update module_error_ty documentation
lexnv f546387
frame: Implement from_dispatch_error
lexnv 9e175b9
frame/support: Adjust test to ModuleErrorType
lexnv a998d91
Fix clippy
lexnv 6e86299
Improve documentation
lexnv f4e1c7c
frame/tests: Check `from_dispatch_error` impl
lexnv c4c0b98
Merge remote-tracking branch 'origin/master' into lexnv/metadata_oute…
lexnv 3abc0d7
Update frame-metadata
lexnv 98de5b2
Remove the module_error_ty
lexnv 9b1c3e7
Apply fmt
lexnv b94bbd1
Revert unneeded parts
lexnv c0dc3d5
Revert "Revert unneeded parts"
lexnv 547dc6f
Update frame-metadata to origin/master
lexnv 9965290
Add outerEnums to the metadata
lexnv e9eee8d
Add tests
lexnv 90ca4fa
Keep backwards compatibility for explicit pallet parts
lexnv a58ee17
Rename tt_error_part to be more generic
lexnv 065a77d
Increase recursion_limit to 1k
lexnv 7382986
Rename `fully_expanded` to `expanded`
lexnv a540c00
Improve documentation
lexnv 157eb85
Adjust UI tests
lexnv 55bf26c
Update UI tests
lexnv c1823a1
Update undefined_validate_unsigned_part.stderr UI test
lexnv 82deaa2
Adjust yet again
lexnv 94e07b9
Optimise macro expansions
lexnv 88beae9
Use latest frame-metadata and rename `moduleErrorType` to `RuntimeError`
lexnv 8970e50
Fix comment
lexnv 029ec04
Apply fmt
lexnv 5c5cda1
Merge remote-tracking branch 'origin/master' into lexnv/metadata_oute…
lexnv b00e525
Update frame/support/procedural/src/construct_runtime/parse.rs
lexnv 81dfddd
Update frame/support/procedural/src/construct_runtime/parse.rs
lexnv 2be265f
Update frame-metadata PR
lexnv 64ee759
Merge remote-tracking branch 'origin/master' into lexnv/metadata_oute…
lexnv dd8008e
Remove `expanded` from error messages and fix typo
lexnv 643e8e0
Move docs to the function
lexnv a472b11
ui: Use the intermed syntax for pallet parts
lexnv 2f50050
Update frame-metadata with latest release
lexnv 386fd68
frame: Address feedback for `from_dispatch_error`
lexnv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update UI tests
Signed-off-by: Alexandru Vasile <[email protected]>
- Loading branch information
commit 55bf26ca0865a80e20d5b45be47d780f8161cb44
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you provide here
expanded?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be the "final state" of the
construct_runtime!, without this the macro will try to get expanded one more time. And the expansions require the pallets to exposett_extra_partsmacro, and for dummy pallets that's not the case (not sure here if this is constructed with only valid pallets 🤔 )There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted this to remove the
expandedword, the output looks similar to before.Some small differences in how the compiler reports the error, most probably related to the extra expansion
Example
missing_event_generic_on_module_with_instance.rs (this is the entire file)
If we don't add the
expandedkeyword this would produce:When we would actually expect:
I'm presuming that because the
construct_runtime!is not in it's final expression (does not contain the expanded), the macro tries to expand the pallet one more time. In doing so it callsbalances::tt_extra_parts!, which does not exist (ie theres nobalancesmodule).The "Instantiable pallet with no generic
Eventcannot be constructed: palletBalancemust have generic" compile error should be coming from the final step of the construct_runtime! macro. And I think it's not outputted/detected because the missing module error has priority for the compiler 🤔Let me know if this sounds right :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkchr would love to get your feedback on the above 🙏