Function build_height_range

Source
fn build_height_range(
    start: Option<u32>,
    end: Option<u32>,
    chain_height: Height,
) -> RpcResult<RangeInclusive<Height>>
Expand description

Build a valid height range from the given optional start and end numbers.

§Parameters

  • start: Optional starting height. If not provided, defaults to 0.
  • end: Optional ending height. A value of 0 or absence of a value indicates to use chain_height.
  • chain_height: The maximum permissible height.

§Returns

A RangeInclusive<Height> from the clamped start to the clamped end.

§Errors

Returns an error if the computed start is greater than the computed end.