Proto/Alpha: add a RPC /context/voting_period_kind
This commit is contained in:
parent
4ded0660d6
commit
58587258dc
@ -72,6 +72,9 @@ module Context = struct
|
||||
let faucet_counter cctxt block =
|
||||
call_error_service1 cctxt Services.Context.faucet_counter block ()
|
||||
|
||||
let voting_period_kind cctxt block =
|
||||
call_error_service1 cctxt Services.Context.voting_period_kind block ()
|
||||
|
||||
module Nonce = struct
|
||||
|
||||
type nonce_info = Services.Context.Nonce.nonce_info =
|
||||
|
@ -64,6 +64,12 @@ module Context : sig
|
||||
Client_rpcs.config ->
|
||||
block -> int32 tzresult Lwt.t
|
||||
|
||||
val voting_period_kind:
|
||||
Client_rpcs.config ->
|
||||
block -> Voting_period.kind tzresult Lwt.t
|
||||
(** [voting_period_kind cctxt blk] returns the voting period kind
|
||||
of [blk]. *)
|
||||
|
||||
module Nonce : sig
|
||||
val hash:
|
||||
Client_rpcs.config ->
|
||||
|
@ -143,6 +143,17 @@ module Context = struct
|
||||
~output: (wrap_tzerror int32)
|
||||
RPC.Path.(custom_root / "context" / "faucet_counter")
|
||||
|
||||
let voting_period_kind custom_root =
|
||||
RPC.service
|
||||
~description: "Voting period kind for the current block"
|
||||
~input: empty
|
||||
~output:
|
||||
(wrap_tzerror @@
|
||||
(obj1
|
||||
(req "voting_period_kind" Voting_period.kind_encoding)))
|
||||
RPC.Path.(custom_root / "context" / "voting_period_kind")
|
||||
|
||||
|
||||
module Nonce = struct
|
||||
|
||||
type nonce_info =
|
||||
|
@ -142,6 +142,10 @@ let () = register0 Services.Context.next_level next_level
|
||||
|
||||
let () = register0 Services.Context.faucet_counter Contract.get_faucet_counter
|
||||
|
||||
let () =
|
||||
register0 Services.Context.voting_period_kind Vote.get_current_period_kind
|
||||
|
||||
|
||||
(*-- Context.Nonce -----------------------------------------------------------*)
|
||||
|
||||
let nonce ctxt raw_level () =
|
||||
|
Loading…
Reference in New Issue
Block a user