fix: runtime API implementations not exported #809
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/KILTprotocol/ticket/issues/3688.
Due to how the
impl_runtime_apis
macro works, it is expected to be included in a runtime'slib.rs
file. Since we split up the runtimes, the runtime APIs were not included anymore. I found a related issue in the subxt repo: paritytech/subxt#1873.Because the trait definition generated by the macro is local, we can't import it in the
lib.rs
module for theconstruct_runtime
macro to pick up the right implementation, so we need a workaround that basically introduces a new marker trait, and we import that in thelib.rs
file so that the right implementation ofRuntime::runtime_metadata()
is picked up. More details about the issue are presented in the subxt ticket.How to test
Spin up a chopsticks deployment after building peregrine and spiritnet runtime, and verify that the runtime APIs are there now.