mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
Add new RPC method to get the chain type (#5576)
* Add new RPC method to get the chain type This adds a new RPC method to get the chain type of the running chain. The chain type needs to be specified in the chain spec. This should make it easier for tools/UI to display extra information without needing to rely on parsing the chain name. * Update client/rpc-api/src/system/mod.rs Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Primitive crate * Feedback Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
@@ -28,7 +28,7 @@ use sp_runtime::traits::{self, Header as HeaderT};
|
||||
use self::error::Result;
|
||||
|
||||
pub use sc_rpc_api::system::*;
|
||||
pub use self::helpers::{Properties, SystemInfo, Health, PeerInfo, NodeRole};
|
||||
pub use self::helpers::{SystemInfo, Health, PeerInfo, NodeRole};
|
||||
pub use self::gen_client::Client as SystemClient;
|
||||
|
||||
/// System API implementation
|
||||
@@ -82,7 +82,11 @@ impl<B: traits::Block> SystemApi<B::Hash, <B::Header as HeaderT>::Number> for Sy
|
||||
Ok(self.info.chain_name.clone())
|
||||
}
|
||||
|
||||
fn system_properties(&self) -> Result<Properties> {
|
||||
fn system_type(&self) -> Result<sp_chain_spec::ChainType> {
|
||||
Ok(self.info.chain_type.clone())
|
||||
}
|
||||
|
||||
fn system_properties(&self) -> Result<sp_chain_spec::Properties> {
|
||||
Ok(self.info.properties.clone())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user