24 lines
1.0 KiB
OCaml
Raw Normal View History

2018-01-15 22:09:25 +01:00
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2016. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
open Proto_alpha
open Alpha_context
2018-01-15 22:09:25 +01:00
open Helpers_assert
let endorsement_rights ~tc () =
let level = Level.current tc in
Alpha_services.Delegate.endorsement_rights tc level None >>=?? fun (_, endorsers) ->
2018-01-15 22:09:25 +01:00
return @@ List.mapi (fun x i -> x, i) endorsers
let baking_rights ~tc () =
Alpha_services.Delegate.baking_rights tc () None >>=?? fun (_, bakers) ->
return @@ List.mapi (fun x (i,_) -> x, i) bakers
2018-01-15 22:09:25 +01:00