Mavryk_raw_protocol_alpha.Sc_rollup_tick_repr
This module defines Tick.t
, an execution step counter for smart-contract rollups.
val initial : t
The initial tick.
val jump : t -> Mavryk_protocol_environment_alpha.Z.t -> t
jump tick k
moves tick
by k
(possibly negative) steps. The move stops at initial
when going back in time.
val distance : t -> t -> Mavryk_protocol_environment_alpha.Z.t
distance t1 t2
is the absolute value of the difference between t1
and t2
.
val of_int : int -> t option
of_int x
returns Some tick
for the rollup x
-th execution step if x
is non-negative. Returns None
otherwise.
val to_int : t -> int option
to_int tick
converts the tick
into an integer.
val of_number_of_ticks : Sc_rollup_repr.Number_of_ticks.t -> t
of_number_of_ticks
converts from the bounded int type defined in the Sc_rollup_repr
module. Number_of_ticks
is used inside of commitments to limit the maximum possible storage requirement. It is bounded between one and max_int
meaning that this can never return a negative number so an option
isn't required.
val of_z : Mavryk_protocol_environment_alpha.Z.t -> t
val to_z : t -> Mavryk_protocol_environment_alpha.Z.t
val size_in_bytes : t -> int
size_in_bytes tick
is the size in bytes of tick
's internal representation. This function is used by the gas model.
val encoding : t Mavryk_protocol_environment_alpha.Data_encoding.t
val pp : Mavryk_protocol_environment_alpha.Format.formatter -> t -> unit
include Mavryk_protocol_environment_alpha.Compare.S with type t := t
module Map : Mavryk_protocol_environment_alpha.Map.S with type key = t