Utility function for unwrapping an optional BlockNumber. If the Option is Some, convert it to a hex string. If the Option is None, use "latest".
(block_number: Option<BlockNumber>)
| 19 | /// If the Option is Some, convert it to a hex string. |
| 20 | /// If the Option is None, use "latest". |
| 21 | pub(crate) fn get_hex_blocknumber(block_number: Option<BlockNumber>) -> String { |
| 22 | block_number.map_or_else( |
| 23 | || "latest".to_string(), |
| 24 | |block_number| to_hex(*block_number), |
| 25 | ) |
| 26 | } |
| 27 | |
| 28 | /// Retrieve the block number of the current block. |
| 29 | /// |