From 9a0cc67062716c94f7405ea0cbc3e6705581502a Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Thu, 12 Oct 2023 11:53:05 +0200 Subject: [PATCH] Proto/Delegate_sampler: remove dead delegate_baking_power_for_cycle --- src/proto_alpha/lib_protocol/alpha_context.mli | 3 --- src/proto_alpha/lib_protocol/delegate_sampler.ml | 15 --------------- src/proto_alpha/lib_protocol/delegate_sampler.mli | 8 -------- 3 files changed, 26 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 14540d7c1661..0b3c80c1e1ce 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -4879,9 +4879,6 @@ module Stake_distribution : sig val get_total_frozen_stake : context -> Cycle.t -> Tez.t tzresult Lwt.t module For_RPC : sig - val delegate_baking_power_for_cycle : - context -> Cycle.t -> Signature.public_key_hash -> int64 tzresult Lwt.t - val delegate_current_baking_power : context -> Signature.public_key_hash -> int64 tzresult Lwt.t end diff --git a/src/proto_alpha/lib_protocol/delegate_sampler.ml b/src/proto_alpha/lib_protocol/delegate_sampler.ml index 5f11a87febef..a3801233c9e6 100644 --- a/src/proto_alpha/lib_protocol/delegate_sampler.ml +++ b/src/proto_alpha/lib_protocol/delegate_sampler.ml @@ -257,21 +257,6 @@ let clear_outdated_sampling_data ctxt ~new_cycle = Seed_storage.remove_for_cycle ctxt outdated_cycle module For_RPC = struct - let delegate_baking_power_for_cycle ctxt cycle delegate = - let open Lwt_result_syntax in - let* max_snapshot_index = Stake_storage.max_snapshot_index ctxt in - let* seed = Seed_storage.raw_for_cycle ctxt cycle in - let* selected_index = - compute_snapshot_index_for_seed ~max_snapshot_index seed - in - let* stake = - Storage.Stake.Staking_balance.Snapshot.get ctxt (selected_index, delegate) - in - let* staking_parameters = - Delegate_staking_parameters.of_delegate ctxt delegate - in - Lwt.return @@ Stake_context.baking_weight ctxt staking_parameters stake - let delegate_current_baking_power ctxt delegate = let open Lwt_result_syntax in let* stake = Storage.Stake.Staking_balance.get ctxt delegate in diff --git a/src/proto_alpha/lib_protocol/delegate_sampler.mli b/src/proto_alpha/lib_protocol/delegate_sampler.mli index 75728dad1672..18cac67c0f6a 100644 --- a/src/proto_alpha/lib_protocol/delegate_sampler.mli +++ b/src/proto_alpha/lib_protocol/delegate_sampler.mli @@ -85,14 +85,6 @@ val select_distribution_for_cycle : Raw_context.t tzresult Lwt.t module For_RPC : sig - (** The baking power for a given delegate from the selected stake - snapshot of the current cycle. *) - val delegate_baking_power_for_cycle : - Raw_context.t -> - Cycle_repr.t -> - Signature.public_key_hash -> - int64 tzresult Lwt.t - (** The baking power for a given delegate computed from its current stake. *) val delegate_current_baking_power : -- GitLab