ismp_parachain_runtime_api/
lib.rs

1// Copyright (C) Polytope Labs Ltd.
2// SPDX-License-Identifier: Apache-2.0
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// 	http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16//! Runtime API for the parachain consensus client.
17
18#![doc = include_str!("../README.md")]
19#![cfg_attr(not(feature = "std"), no_std)]
20#![deny(missing_docs)]
21
22extern crate alloc;
23
24use alloc::vec::Vec;
25use cumulus_pallet_parachain_system::RelayChainState;
26use polkadot_sdk::*;
27
28sp_api::decl_runtime_apis! {
29	/// Ismp Parachain consensus client runtime APIs
30	pub trait IsmpParachainApi {
31		/// Return all the para_ids this runtime is interested in. Used by the inherent provider
32		fn para_ids() -> Vec<u32>;
33
34		/// Return the current relay chain state.
35		fn current_relay_chain_state() -> RelayChainState;
36	}
37}