Metadata V15: Add Runtime API metadata (#13302)
* impl_runtime_apis: Generate getters for `metadata_at` functions Signed-off-by:Alexandru Vasile <alexandru.vasile@parity.io> * runtime: Implement new `Metadata` runtime trait Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * runtime: Move `metadata_at` functions to construct_runtime macro Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * contruct_runtime: Use `OpaqueMetadata` from hidden imports Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Adjust testing Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/tests: Add tests for the new API Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/proc-macro: Helper to extract documentation literals Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/proc-macro: Helper to filter all `cfg` attributes Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/proc-macro: Generate documentation getters for metadata Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/proc-macro: Avoid trait collision with snake case methods Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * proc-macro/tests: Check doc getters Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/proc-macro: Generate metadata for runtime methods Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/api: Export scale-info and frame-metadata Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/proc-macro: Generate metadata for runtime traits Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/runtime: Expose metadata v15 internally Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * test: Use metadata v15 from `lexnv/md_v15_test` branch Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/proc-macro: Generate crate access one module up Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame: Implement `runtime_metadata` for mocks and tests Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/proc-macro: Fix warnings Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/proc-macro: Add no-docs flag Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame: Adjust more tests Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/tests: Check runtime metadata correctness Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/benchmarking: Adjust benchmarks Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/benchmarks: Adjust more benchmarks Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/api: Fix clippy Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/proc-macro: Generate runtime metadata on the `decl_runtime_apis` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame: Abuse Deref to resolve `runtime_metadata` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Revert "frame: Implement `runtime_metadata` for mocks and tests" This reverts commit b7f41aa189218589392a6e713ea9488e93c4db45. Revert "frame: Adjust more tests" This reverts commit 3cba5982c7f45552e76335e96c430aecbc42d8c6. Revert "frame/benchmarking: Adjust benchmarks" This reverts commit 60b382ada486c791ffceeb65da587e949b90ec5d. Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> Revert "frame/benchmarks: Adjust more benchmarks" This reverts commit eb75c477179b1a27347a5554c5732ef26a00d7e8. * primitives/proc-macro: Remove unused imports and function Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/support: Adjust runtime metadata test Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/tests: Remove doc getter test Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/support: Enable `no-metadata-docs` feature from `sp-api` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/tests: Add `TypeInfo` for test::extrinsic Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/api: Expose scale-info and frame-metadata Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update frame-metadata to include v15 Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix merge conflicts Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/metadata_ir: Add IR for runtime API metadata Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/metadata_ir: Convert IR to V15 Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/api: Collect IR metadata for runtime API Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/api: Move `metadata_ir` from frame/support Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/tests: Adjust testing Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame/tests: Adjust `metadata_versions` test Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/runtime_metadata: Exclude default type parameters from methods Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update primitives/api/proc-macro/src/runtime_metadata.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Update primitives/api/src/metadata_ir/types.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Update primitives/api/src/metadata_ir/mod.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Update primitives/api/proc-macro/src/utils.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Update primitives/api/proc-macro/src/runtime_metadata.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Update primitives/api/proc-macro/src/runtime_metadata.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Update primitives/api/proc-macro/src/runtime_metadata.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Update primitives/api/proc-macro/src/runtime_metadata.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Update primitives/api/proc-macro/src/runtime_metadata.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Update primitives/api/proc-macro/src/runtime_metadata.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * primitives: Fix build Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives/metadata-ir: Move IR to dedicated crate Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives: Reexport metadata-ir and frame-metadata Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * frame: Use apis field instead of runtime Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Better documentation for the `Deref` abstraction Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * ui-tests: Check empty `impl_runtime_apis` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives: Remove unneeded bounds on generic params Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives: Rename `collect_where_bounds` to `get_argument_type_param` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives: Generate crate access per fn call Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Revert "primitives: Remove unneeded bounds on generic params" This reverts commit 5178e38cf21cfb481156eefd628d62989201d59a. * metadata-ir: Add no-std Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * primitives: Adjust where bounds Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Change `frame-metadata` branch to "origin/main" Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update to `main` from origin Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update frame-metadata to crates.io v15.1 Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Revert "ui-tests: Check empty `impl_runtime_apis`" This reverts commit cf78a7190ad9cba3c3bb2e78dc3d0dc382b2fea9. * Move ui test to primitives/ui Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update frame/support/test/tests/runtime_metadata.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Update primitives/api/proc-macro/src/runtime_metadata.rs Co-authored-by:
Bastian Köcher <git@kchr.de> * Test already covered by `empty_impl_runtime_apis_call.stderr` This reverts commit 3bafb294cbe9745569bf5e5a1a2e6b4a4c1aadc5. * Retriger CI Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Import `TokenStream` as `TokenStream2` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: parity-processbot <> Co-authored-by:
Bastian Köcher <git@kchr.de>
Showing
- substrate/Cargo.lock 17 additions, 2 deletionssubstrate/Cargo.lock
- substrate/Cargo.toml 1 addition, 0 deletionssubstrate/Cargo.toml
- substrate/frame/support/Cargo.toml 2 additions, 2 deletionssubstrate/frame/support/Cargo.toml
- substrate/frame/support/procedural/src/construct_runtime/expand/metadata.rs 20 additions, 1 deletion...pport/procedural/src/construct_runtime/expand/metadata.rs
- substrate/frame/support/procedural/src/construct_runtime/mod.rs 25 additions, 0 deletions...ate/frame/support/procedural/src/construct_runtime/mod.rs
- substrate/frame/support/src/lib.rs 1 addition, 1 deletionsubstrate/frame/support/src/lib.rs
- substrate/frame/support/test/Cargo.toml 2 additions, 0 deletionssubstrate/frame/support/test/Cargo.toml
- substrate/frame/support/test/tests/pallet.rs 1 addition, 1 deletionsubstrate/frame/support/test/tests/pallet.rs
- substrate/frame/support/test/tests/runtime_metadata.rs 222 additions, 0 deletionssubstrate/frame/support/test/tests/runtime_metadata.rs
- substrate/primitives/api/Cargo.toml 6 additions, 1 deletionsubstrate/primitives/api/Cargo.toml
- substrate/primitives/api/proc-macro/Cargo.toml 3 additions, 0 deletionssubstrate/primitives/api/proc-macro/Cargo.toml
- substrate/primitives/api/proc-macro/src/decl_runtime_apis.rs 15 additions, 10 deletionssubstrate/primitives/api/proc-macro/src/decl_runtime_apis.rs
- substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs 12 additions, 7 deletionssubstrate/primitives/api/proc-macro/src/impl_runtime_apis.rs
- substrate/primitives/api/proc-macro/src/lib.rs 1 addition, 0 deletionssubstrate/primitives/api/proc-macro/src/lib.rs
- substrate/primitives/api/proc-macro/src/runtime_metadata.rs 271 additions, 0 deletionssubstrate/primitives/api/proc-macro/src/runtime_metadata.rs
- substrate/primitives/api/proc-macro/src/utils.rs 68 additions, 1 deletionsubstrate/primitives/api/proc-macro/src/utils.rs
- substrate/primitives/api/src/lib.rs 5 additions, 1 deletionsubstrate/primitives/api/src/lib.rs
- substrate/primitives/consensus/beefy/src/lib.rs 1 addition, 1 deletionsubstrate/primitives/consensus/beefy/src/lib.rs
- substrate/primitives/metadata-ir/Cargo.toml 28 additions, 0 deletionssubstrate/primitives/metadata-ir/Cargo.toml
- substrate/primitives/metadata-ir/src/lib.rs 30 additions, 2 deletionssubstrate/primitives/metadata-ir/src/lib.rs
Please register or sign in to comment