RuntimeApis not exposed in the parachain template #6659
Labels
I2-bug
The node fails to follow expected behavior.
I10-unconfirmed
Issue might be valid, but it's not yet known.
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
Hey all,
The parachain template is by configured by default in a way, that does not expose the Runtime API calls information.
That's because
impl_runtime_apis!
macro is used in a separate module (apis
) and it breaks the trait visibility.I found the issue originally when integrating with subxt, more details on the investigation are here: paritytech/subxt#1873.
Steps to reproduce
#3817 -> introduced a refactoring of the parachain template.
It moves the
impl_runtime_apis
decl into another module calledapis
.Effectivly, trait
InternalImplRuntimeApis
ends up being undercrate::apis::InternalImplRuntimeApis
, not in thecrate::InternalImplRuntimeApis
.When
construct_runtime
macro is expanded and uses(&rt).runtime_metadata
, it's expanded undercrate::*
and has no visibility intocrate::apis::InternalImplRuntimeApis
, because:a) trait is private
b) construct macro is not importing api::*
So in the end, the 'default, backward compatible' implementation is used.
The text was updated successfully, but these errors were encountered: