/// Obtain `BlockInfo` for the provided block number
Obtain `BlockInfo` for the provided block number
Obtain ` BlockInfo ` for the provided block number
pub fn block_info(&mut self, block_num: u64) -> BlockInfo {
        let block_info = &self.get_block(block_num).unwrap_or(JsonValue::Null)["result"];
        let ts = block_info["timestamp"].as_str().unwrap_or("0x0");
        let gas_limit = block_info["gas_limit"].as_str().unwrap_or("0x0");
        BlockInfo {
            block_num,
            time_stamp: hex_to_u64(ts).unwrap_or(0),
            gas_limit: hex_to_u64(gas_limit).unwrap_or(0),
        }
    }
pub fn block_info ( & mut self , block_num : u64 ) -> BlockInfo { let block_info = & self . get_block ( block_num ) . unwrap_or ( JsonValue :: Null ) [ " " ] ; let ts = block_info [ " " ] . as_str ( ) . unwrap_or ( " " ) ; let gas_limit = block_info [ " " ] . as_str ( ) . unwrap_or ( " " ) ; BlockInfo { block_num , time_stamp : hex_to_u64 ( ts ) . unwrap_or ( 0 ) , gas_limit : hex_to_u64 ( gas_limit ) . unwrap_or ( 0 ) , } }
Obtain `BlockInfo` for the provided block number
Obtain ` BlockInfo ` for the provided block number
&mut self
block_num
u64