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

Metadata V15: Expose types for the overarching Call, Event, Error enums #14143

Merged
merged 57 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
ac824b1
frame-metadata: Point to unreleased branch
lexnv May 11, 2023
e9c2fd3
frame: Generalize outer enum generation for events and errors
lexnv May 12, 2023
6707973
frame: Remove individual generation of outer enum events
lexnv May 12, 2023
a41c847
primitives/traits: Add marker trait for outer runtime enums
lexnv May 15, 2023
a04007f
frame: Derive Clone, PartialEq, Eq for RuntimeEvents only
lexnv May 15, 2023
cb6309f
frame/pallet: Include `#[pallet::error]` enum into pallet parts
lexnv May 15, 2023
cf0e3e2
metadata-ir: Include call, event, error types
lexnv May 15, 2023
8638fbb
frame/metadata: Include outer enum types in V15 metadata
lexnv May 15, 2023
6d9af4b
frame/tests: Ensure `RuntimeError` includes `#[pallet::error]` parts
lexnv May 15, 2023
eca5422
frame/support: Document the reserved name for `RuntimeError`
lexnv May 15, 2023
ca130b3
frame: Use self-generated `RuntimeEvent` for `GetRuntimeOuterEnumTypes`
lexnv May 15, 2023
b004ae3
frame/ui: Fix UI tests
lexnv May 15, 2023
1e00fed
frame/support: Remove unused system path
lexnv May 15, 2023
42b7d98
frame/ui: Unexpected field and reintroduce frame_system::Config for R…
lexnv May 15, 2023
85c5aeb
frame/support: Remove `GetRuntimeOuterEnumTypes` marker trait
lexnv May 25, 2023
f65172d
frame/support: Remove `;` from macro
lexnv May 25, 2023
8ac30ba
Update frame-metadata to point to unreleased branch
lexnv Jun 7, 2023
9849d4b
Rename error_enum_ty to module_error_enum_ty
lexnv Jun 7, 2023
7228348
Merge remote-tracking branch 'origin/master' into lexnv/metadata_oute…
lexnv Jun 7, 2023
e7b9829
Update module_error_ty documentation
lexnv Jun 7, 2023
f546387
frame: Implement from_dispatch_error
lexnv Jun 7, 2023
9e175b9
frame/support: Adjust test to ModuleErrorType
lexnv Jun 7, 2023
a998d91
Fix clippy
lexnv Jun 7, 2023
6e86299
Improve documentation
lexnv Jun 8, 2023
f4e1c7c
frame/tests: Check `from_dispatch_error` impl
lexnv Jun 13, 2023
c4c0b98
Merge remote-tracking branch 'origin/master' into lexnv/metadata_oute…
lexnv Jun 13, 2023
3abc0d7
Update frame-metadata
lexnv Jun 15, 2023
98de5b2
Remove the module_error_ty
lexnv Jun 15, 2023
9b1c3e7
Apply fmt
lexnv Jun 15, 2023
b94bbd1
Revert unneeded parts
lexnv Jun 15, 2023
c0dc3d5
Revert "Revert unneeded parts"
lexnv Jun 19, 2023
547dc6f
Update frame-metadata to origin/master
lexnv Jun 19, 2023
9965290
Add outerEnums to the metadata
lexnv Jun 19, 2023
e9eee8d
Add tests
lexnv Jun 19, 2023
90ca4fa
Keep backwards compatibility for explicit pallet parts
lexnv Jun 19, 2023
a58ee17
Rename tt_error_part to be more generic
lexnv Jun 19, 2023
065a77d
Increase recursion_limit to 1k
lexnv Jun 20, 2023
7382986
Rename `fully_expanded` to `expanded`
lexnv Jun 20, 2023
a540c00
Improve documentation
lexnv Jun 20, 2023
157eb85
Adjust UI tests
lexnv Jun 20, 2023
55bf26c
Update UI tests
lexnv Jun 20, 2023
c1823a1
Update undefined_validate_unsigned_part.stderr UI test
lexnv Jun 20, 2023
82deaa2
Adjust yet again
lexnv Jun 20, 2023
94e07b9
Optimise macro expansions
lexnv Jun 20, 2023
88beae9
Use latest frame-metadata and rename `moduleErrorType` to `RuntimeError`
lexnv Jun 20, 2023
8970e50
Fix comment
lexnv Jun 20, 2023
029ec04
Apply fmt
lexnv Jun 20, 2023
5c5cda1
Merge remote-tracking branch 'origin/master' into lexnv/metadata_oute…
lexnv Jun 20, 2023
b00e525
Update frame/support/procedural/src/construct_runtime/parse.rs
lexnv Jun 21, 2023
81dfddd
Update frame/support/procedural/src/construct_runtime/parse.rs
lexnv Jun 21, 2023
2be265f
Update frame-metadata PR
lexnv Jun 21, 2023
64ee759
Merge remote-tracking branch 'origin/master' into lexnv/metadata_oute…
lexnv Jun 21, 2023
dd8008e
Remove `expanded` from error messages and fix typo
lexnv Jun 21, 2023
643e8e0
Move docs to the function
lexnv Jun 21, 2023
a472b11
ui: Use the intermed syntax for pallet parts
lexnv Jun 21, 2023
2f50050
Update frame-metadata with latest release
lexnv Jun 27, 2023
386fd68
frame: Address feedback for `from_dispatch_error`
lexnv Jun 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frame/support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
serde = { version = "1.0.136", optional = true, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive", "max-encoded-len"] }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
frame-metadata = { version = "15.1.0", default-features = false, features = ["v14", "v15-unstable"] }
frame-metadata = { git = "https://github.com/paritytech/frame-metadata.git", branch = "lexnv/metadata_outer_enums", default-features = false, features = ["v14", "v15-unstable"] }
lexnv marked this conversation as resolved.
Show resolved Hide resolved
sp-api = { version = "4.0.0-dev", default-features = false, path = "../../primitives/api" }
sp-std = { version = "5.0.0", default-features = false, path = "../../primitives/std" }
sp-io = { version = "7.0.0", default-features = false, path = "../../primitives/io" }
Expand Down
168 changes: 0 additions & 168 deletions frame/support/procedural/src/construct_runtime/expand/event.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ pub fn expand_runtime_metadata(
},
ty: #scrate::scale_info::meta_type::<#runtime>(),
apis: (&rt).runtime_metadata(),
call_enum_ty: #scrate::scale_info::meta_type::<
<#runtime as #scrate::sp_runtime::traits::GetRuntimeOuterEnumTypes>::RuntimeCall
>(),
event_enum_ty: #scrate::scale_info::meta_type::<
<#runtime as #scrate::sp_runtime::traits::GetRuntimeOuterEnumTypes>::RuntimeEvent
>(),
error_enum_ty: #scrate::scale_info::meta_type::<
<#runtime as #scrate::sp_runtime::traits::GetRuntimeOuterEnumTypes>::RuntimeError
>(),
}
}

Expand Down
4 changes: 2 additions & 2 deletions frame/support/procedural/src/construct_runtime/expand/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@

mod call;
mod config;
mod event;
mod freeze_reason;
mod hold_reason;
mod inherent;
mod lock_id;
mod metadata;
mod origin;
mod outer_enums;
mod slash_reason;
mod unsigned;

pub use call::expand_outer_dispatch;
pub use config::expand_outer_config;
pub use event::expand_outer_event;
pub use freeze_reason::expand_outer_freeze_reason;
pub use hold_reason::expand_outer_hold_reason;
pub use inherent::expand_outer_inherent;
pub use lock_id::expand_outer_lock_id;
pub use metadata::expand_runtime_metadata;
pub use origin::expand_outer_origin;
pub use outer_enums::{expand_outer_enum, OuterEnumType};
pub use slash_reason::expand_outer_slash_reason;
pub use unsigned::expand_outer_validate_unsigned;
Loading