From a90e2ebcca73f39cfae67c3d6653bf39b0384586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cauderlier?= Date: Tue, 1 Apr 2025 12:26:43 +0200 Subject: [PATCH] Proto: expose all service definitions This commit exposes in all *_services.mli files the S modules containing the definitions of the services. This commit does not modify the implementation of the protocol, only what is exposed in the interfaces. --- .../adaptive_issuance_services.mli | 76 +++++++++++++ .../lib_protocol/alpha_services.mli | 102 +++++++++++++++++- .../lib_protocol/constants_services.mli | 29 +++++ .../lib_protocol/voting_services.mli | 94 ++++++++++++++++ 4 files changed, 300 insertions(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_protocol/adaptive_issuance_services.mli b/src/proto_alpha/lib_protocol/adaptive_issuance_services.mli index f5ee2a498941..30b7dcb8db99 100644 --- a/src/proto_alpha/lib_protocol/adaptive_issuance_services.mli +++ b/src/proto_alpha/lib_protocol/adaptive_issuance_services.mli @@ -63,3 +63,79 @@ val expected_issuance : 'a #RPC_context.simple -> 'a -> expected_rewards list shell_tzresult Lwt.t val register : unit -> unit + +module S : sig + val q_encoding : Q.t Data_encoding.t + + val total_supply : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Tez.t ) + RPC_service.t + + val total_frozen_stake : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Tez.t ) + RPC_service.t + + val current_yearly_rate : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + string ) + RPC_service.t + + val current_yearly_rate_exact : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Q.t ) + RPC_service.t + + val current_yearly_rate_details : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Q.t * Q.t ) + RPC_service.t + + val current_issuance_per_minute : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Tez.t ) + RPC_service.t + + val launch_cycle : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Cycle.t option ) + RPC_service.t + + val expected_issuance : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + expected_rewards list ) + RPC_service.t +end diff --git a/src/proto_alpha/lib_protocol/alpha_services.mli b/src/proto_alpha/lib_protocol/alpha_services.mli index 83c4848d5858..a896bbf4487a 100644 --- a/src/proto_alpha/lib_protocol/alpha_services.mli +++ b/src/proto_alpha/lib_protocol/alpha_services.mli @@ -40,10 +40,35 @@ module Seed_computation : sig 'a #RPC_context.simple -> 'a -> Seed.seed_computation_status shell_tzresult Lwt.t + + module S : sig + val seed_computation_status_encoding : + Seed.seed_computation_status Data_encoding.t + + val seed_computation : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Seed.seed_computation_status ) + RPC_service.t + end end module Seed : sig val get : 'a #RPC_context.simple -> 'a -> Seed.seed shell_tzresult Lwt.t + + module S : sig + val seed : + ( [`POST], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Seed.seed ) + RPC_service.t + end end module Nonce : sig @@ -51,6 +76,17 @@ module Nonce : sig val get : 'a #RPC_context.simple -> 'a -> Raw_level.t -> info shell_tzresult Lwt.t + + module S : sig + val get : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context * Raw_level.t, + unit, + unit, + info ) + RPC_service.t + end end module Constants = Constants_services @@ -60,6 +96,17 @@ module Sapling = Sapling_services module Liquidity_baking : sig val get_cpmm_address : 'a #RPC_context.simple -> 'a -> Contract_hash.t shell_tzresult Lwt.t + + module S : sig + val get_cpmm_address : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Contract_hash.t ) + RPC_service.t + end end module Cache : sig @@ -79,13 +126,66 @@ module Cache : sig 'a -> Contract_hash.t -> int option shell_tzresult Lwt.t + + module S : sig + val cached_contracts : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + (Contract_hash.t * int) list ) + RPC_service.t + + val contract_cache_size : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + int ) + RPC_service.t + + val contract_cache_size_limit : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + int ) + RPC_service.t + + val contract_rank : + ( [`POST], + Updater.rpc_context, + Updater.rpc_context, + unit, + Contract_hash.t, + int option ) + RPC_service.t + end end module Denunciations : sig + type denunciations_with_key = public_key_hash * Denunciations_repr.item + + val denunciations_with_key_encoding : denunciations_with_key Data_encoding.t + val denunciations : 'a #RPC_context.simple -> 'a -> - (public_key_hash * Denunciations_repr.item) list shell_tzresult Lwt.t + denunciations_with_key list shell_tzresult Lwt.t + + module S : sig + val denunciations : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + denunciations_with_key list ) + RPC_service.t + end end val register : unit -> unit diff --git a/src/proto_alpha/lib_protocol/constants_services.mli b/src/proto_alpha/lib_protocol/constants_services.mli index 97294ab20ad2..96a65cf6f267 100644 --- a/src/proto_alpha/lib_protocol/constants_services.mli +++ b/src/proto_alpha/lib_protocol/constants_services.mli @@ -36,3 +36,32 @@ val parametric : 'a #RPC_context.simple -> 'a -> Constants.Parametric.t shell_tzresult Lwt.t val register : unit -> unit + +module S : sig + val errors : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Data_encoding.json_schema ) + RPC_service.t + + val all : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Constants.t ) + RPC_service.t + + val parametric : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Constants.Parametric.t ) + RPC_service.t +end diff --git a/src/proto_alpha/lib_protocol/voting_services.mli b/src/proto_alpha/lib_protocol/voting_services.mli index 377ce0806597..180a52568b40 100644 --- a/src/proto_alpha/lib_protocol/voting_services.mli +++ b/src/proto_alpha/lib_protocol/voting_services.mli @@ -67,3 +67,97 @@ val delegate_proposal_count : 'a -> Signature.Public_key_hash.t -> int shell_tzresult Lwt.t + +module S : sig + val path : (Updater.rpc_context, Updater.rpc_context) RPC_path.t + + val ballots : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Vote.ballots ) + RPC_service.t + + val ballot_list : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + (public_key_hash * Vote.ballot) list ) + RPC_service.t + + val current_period : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Voting_period.info ) + RPC_service.t + + val successor_period : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Voting_period.info ) + RPC_service.t + + val current_quorum : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + int32 ) + RPC_service.t + + val listings : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + (public_key_hash * int64) list ) + RPC_service.t + + val proposals : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + int64 Protocol_hash.Map.t ) + RPC_service.t + + val current_proposal : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + Protocol_hash.t option ) + RPC_service.t + + val total_voting_power : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context, + unit, + unit, + int64 ) + RPC_service.t + + val delegate_proposal_count : + ( [`GET], + Updater.rpc_context, + Updater.rpc_context * public_key_hash, + unit, + unit, + int ) + RPC_service.t +end -- GitLab