pub async fn block_hash(
        &self,
        block_number: Option<BlockNumber>,
    ) -> Result<Option<T::Hash>, Error> {
        let block_number = block_number.map(ListOrValue::Value);
        let params = &[to_json_value(block_number)?];
        let list_or_value = self.client.request("chain_getBlockHash", params).await?;
        match list_or_value {
            ListOrValue::Value(hash) => Ok(hash),
            ListOrValue::List(_) => Err("Expected a Value, got a List".into()),
        }
    }
/// Get a block hash, returns hash of latest block by default
Get a block hash, returns hash of latest block by default
Get a block hash returns hash of latest block by default
pub async fn block_hash(
        &self,
        block_number: Option<BlockNumber>,
    ) -> Result<Option<T::Hash>, Error> {
        let block_number = block_number.map(ListOrValue::Value);
        let params = &[to_json_value(block_number)?];
        let list_or_value = self.client.request("chain_getBlockHash", params).await?;
        match list_or_value {
            ListOrValue::Value(hash) => Ok(hash),
            ListOrValue::List(_) => Err("Expected a Value, got a List".into()),
        }
    }
pub async fn block_hash ( & self , block_number : Option < BlockNumber > , ) -> Result < Option < T :: Hash > , Error > { let block_number = block_number . map ( ListOrValue :: Value ) ; let params = & [ to_json_value ( block_number ) ? ] ; let list_or_value = self . client . request ( " " , params ) . await ? ; match list_or_value { ListOrValue :: Value ( hash ) => Ok ( hash ) , ListOrValue :: List ( _ ) => Err ( " " . into ( ) ) , } }
Get a block hash, returns hash of latest block by default
Get a block hash returns hash of latest block by default
&self
block_number
Option<BlockNumber>
&self
block_number
Option<BlockNumber>