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. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2018-02-11 19:17:40 +01:00
|
|
|
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
|
2018-02-11 19:17:40 +01:00
|
|
|
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 () =
|
2018-02-11 19:17:40 +01:00
|
|
|
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
|
|
|
|