You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Gets the hash of the block with given number.
# [rpc(name = "chain_getBlockHash")]
fn get_block_hash(&self, u64) -> Result<Option<H256>>;
The above declaration is a part of the pub trait Chain. It creates the RPC endpoint to "chain_getBlockHash" which receives u64 parameter. All of the parameters must be serde-Serializable. See files in the src/rpc/v1/types/ directory.
The above implementation is a part of the impl Chain for ChainClient. ChainClient holds Client and Miner which are structs for both the blockchain and the transaction queue.
The above shows chain_getBlockHash, which is implemented using the block_hash function in Client.