Mavryk_raw_protocol_alpha.Dal_slot_index_reprSlot index
A slot index is a possible value for a slot index with an upper bound. If a choice is ever made to increase the size of available slots in the protocol, we also need to change this module to accommodate for higher values.
val encoding : t Mavryk_protocol_environment_alpha.Data_encoding.tval pp : Mavryk_protocol_environment_alpha.Format.formatter -> t -> unitval zero : tval check_is_in_range :
number_of_slots:int ->
t ->
unit Mavryk_protocol_environment_alpha.Error_monad.tzresultval of_int :
number_of_slots:int ->
int ->
t Mavryk_protocol_environment_alpha.Error_monad.tzresultof_int ~number_of_slots n constructs a value of type t from n. Returns Invalid_slot_index in case the given value is not in the interval [zero, number_of_slots-1].
val of_int_opt : number_of_slots:int -> int -> t optionof_int_opt ~number_of_slots n constructs a value of type t from n. Returns None in case the given value is not in the interval [zero, number_of_slots-1].
val to_int : t -> intval to_int_list : t list -> int listval slots_range :
number_of_slots:int ->
lower:int ->
upper:int ->
t list Mavryk_protocol_environment_alpha.Error_monad.tzresultslots_range ~number_of_slots ~lower ~upper returns the list of slots indexes between lower and upper.
If lower is negative or upper is bigger than or equal to number_of_slots, the function returns Invalid_slot_index.
val slots_range_opt :
number_of_slots:int ->
lower:int ->
upper:int ->
t list optionslots_range_opt ~number_of_slots ~lower ~upper is similar to slots_range, but return None instead of an error.
include Mavryk_protocol_environment_alpha.Compare.S with type t := t