Skip to content

[subxt-historic] Add support for Runtime APIs and View Functions to frame-decode and scale-info-legacy. #2086

@jsdw

Description

@jsdw

This partially blocks the other threads and so should be a priority, though we can make good progress on everything else in the meantime, so I don’t anticipate it blocking anything if handled separately.

Frame-decode contains traits which pull extrinsic and storage information from metadata, and methods which combine these with type information to decode some bytes. Modern type information is available in the metadata in the form of a scale_info::PortableRegistry. Legacy type information is available via scale_info_legacy::TypeRegistrySet.

What I would propose here is that we add Runtime API type information into scale-info-legacy, so that it’s possible to iterate over information about the available runtime APIs and fetch arguments and return types at a specific spec version for a given Runtime API.

In frame-decode, we then have a trait for fetching this information which is akin to StorageTypeInfo and ExtrinsicTypeInfo, and this is implemented on V15+ frame metadata, but also on our scale-info-legacy type containing runtime APIs to handle pre-V15. Likewise, we can have a frame-decode/src/utils/list_runtime_apis.rs for listing available Runtime APIs, which is like frame_decode/src/utils/list_storage_entries.rs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions