Allow to call arbitrary runtime apis using RelayChainInterface (#5521)
When using the relay chain though a `Arc<dyn RelayChainInterface>` there
is no way to call arbitrary runtime apis. Both implementations of that
trait allow this, so it feels natural to expose this functionality in
the trait.
This PR adds a `call_runtime_api` method to RelayChainInterface trait,
and a separate function also named `call_runtime_api` which allows the
caller to specify the input and output types, as opposed to having to
encode them. This generic function cannot be part of the trait because a
`dyn Trait` object cannot have generic methods.
---------
Co-authored-by:
Bastian Köcher <git@kchr.de>
parent
86bb5cb5
Showing
- cumulus/client/consensus/common/src/tests.rs 9 additions, 0 deletionscumulus/client/consensus/common/src/tests.rs
- cumulus/client/network/src/tests.rs 9 additions, 0 deletionscumulus/client/network/src/tests.rs
- cumulus/client/pov-recovery/src/tests.rs 9 additions, 0 deletionscumulus/client/pov-recovery/src/tests.rs
- cumulus/client/relay-chain-inprocess-interface/src/lib.rs 18 additions, 1 deletioncumulus/client/relay-chain-inprocess-interface/src/lib.rs
- cumulus/client/relay-chain-interface/src/lib.rs 35 additions, 2 deletionscumulus/client/relay-chain-interface/src/lib.rs
- cumulus/client/relay-chain-rpc-interface/src/lib.rs 12 additions, 0 deletionscumulus/client/relay-chain-rpc-interface/src/lib.rs
- cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs 20 additions, 6 deletionscumulus/client/relay-chain-rpc-interface/src/rpc_client.rs
- prdoc/pr_5521.prdoc 24 additions, 0 deletionsprdoc/pr_5521.prdoc
Please register or sign in to comment