mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
rpc: add rpc v2 chainSpec to polkadot (#2859)
The [chainSpec RPC API from the v2 spec](https://paritytech.github.io/json-rpc-interface-spec/api/chainSpec.html) was only added to substrate-node and should be added to polkadot as well /cc @lexnv
This commit is contained in:
@@ -53,5 +53,12 @@ where
|
||||
// to call into the runtime.
|
||||
// `module.merge(YourRpcTrait::into_rpc(YourRpcStruct::new(ReferenceToClient, ...)))?;`
|
||||
|
||||
// You probably want to enable the `rpc v2 chainSpec` API as well
|
||||
//
|
||||
// let chain_name = chain_spec.name().to_string();
|
||||
// let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
|
||||
// let properties = chain_spec.properties();
|
||||
// module.merge(ChainSpec::new(chain_name, genesis_hash, properties).into_rpc())?;
|
||||
|
||||
Ok(module)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user