pallet_sidechain_rpc/types/
mod.rs

1mod sidechain;
2
3pub use sidechain::*;
4use sp_blockchain::HeaderBackend;
5use sp_runtime::traits::Block as BlockT;
6
7/// Blockchain client for retrieving the latest Partner Chain block hash
8pub trait GetBestHash<Block: BlockT> {
9	/// Returns the latest Partner Chain block hash
10	fn best_hash(&self) -> Block::Hash;
11}
12
13impl<Block, T> GetBestHash<Block> for T
14where
15	T: HeaderBackend<Block>,
16	Block: BlockT,
17{
18	fn best_hash(&self) -> Block::Hash {
19		self.info().best_hash
20	}
21}