diff --git a/src/proto_alpha/lib_protocol/src/baking.ml b/src/proto_alpha/lib_protocol/src/baking.ml index cb691db0f..c9a033336 100644 --- a/src/proto_alpha/lib_protocol/src/baking.ml +++ b/src/proto_alpha/lib_protocol/src/baking.ml @@ -169,7 +169,7 @@ let check_endorsements_rights c level slots = return delegate let paying_priorities c = - 0 --> Constants.first_free_baking_slot c + 0 --> (Constants.first_free_baking_slot c - 1) let bond_and_reward = match Tez.(Constants.baking_bond_cost +? Constants.baking_reward) with diff --git a/src/proto_alpha/lib_protocol/src/misc.ml b/src/proto_alpha/lib_protocol/src/misc.ml index cd06faf7c..6c8ad7951 100644 --- a/src/proto_alpha/lib_protocol/src/misc.ml +++ b/src/proto_alpha/lib_protocol/src/misc.ml @@ -11,13 +11,13 @@ type 'a lazyt = unit -> 'a type 'a lazy_list_t = LCons of 'a * ('a lazy_list_t tzresult Lwt.t lazyt) type 'a lazy_list = 'a lazy_list_t tzresult Lwt.t -let rec (-->) i j = (* [i; i+1; ...; j-1] *) - if Compare.Int.(i >= j) +let rec (-->) i j = (* [i; i+1; ...; j] *) + if Compare.Int.(i > j) then [] else i :: (succ i --> j) -let rec (--->) i j = (* [i; i+1; ...; j-1] *) - if Compare.Int32.(i >= j) +let rec (--->) i j = (* [i; i+1; ...; j] *) + if Compare.Int32.(i > j) then [] else i :: (Int32.succ i ---> j) diff --git a/src/proto_alpha/lib_protocol/src/misc.mli b/src/proto_alpha/lib_protocol/src/misc.mli index 04af3dfef..f646f2c57 100644 --- a/src/proto_alpha/lib_protocol/src/misc.mli +++ b/src/proto_alpha/lib_protocol/src/misc.mli @@ -13,7 +13,7 @@ type 'a lazyt = unit -> 'a type 'a lazy_list_t = LCons of 'a * ('a lazy_list_t tzresult Lwt.t lazyt) type 'a lazy_list = 'a lazy_list_t tzresult Lwt.t -(** Include lower bound, exclude upper bound *) +(** Include bounds *) val (-->) : int -> int -> int list val (--->) : Int32.t -> Int32.t -> Int32.t list