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

impl_runtime_apis does not work if sp-api is not in scope #14145

Closed
@kianenigma

Description

@kianenigma

Somewhat similar to paritytech/polkadot-sdk#173, it seems like this macro also does not work if sp-api is not directly in scope as a dependency. The error message is very cryptic:

error: proc macro panicked
   --> staging-runtime/src/lib.rs:114:1
    |
114 | / impl_runtime_apis! {
115 | |     impl frame_runtime::runtime_apis::Core<Block> for Runtime {
116 | |         fn version() -> RuntimeVersion {
117 | |             VERSION
...   |
177 | |     }
178 | | }
    | |_^
    |
    = help: message: unexpected token

This prevents eg. #14137 to re-export sp_api::Core and impl_runtime_apis in a way that is meaningfully usable.

Note that for rest of the APIs, like sp_block_builder you can import it from a 3rd party re-export them from somewhere else and it works. Although, you need make sure to re-export them like pub use sp_block_builder::* to re-export some magic generated by decl_runtime_apis! as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I3-bugThe node fails to follow expected behavior.

    Type

    No type

    Projects

    Status

    done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions