Skip to content
Unverified Commit c81569ef authored by James Wilson's avatar James Wilson Committed by GitHub
Browse files

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: default avatarBastian Köcher <[email protected]>
Co-authored-by: default avatarGitHub Action <[email protected]>
parent d1620f06
Pipeline #504451 waiting for manual action with stages
in 33 minutes and 47 seconds