diff --git a/crates/sdk/src/rpc.rs b/crates/sdk/src/rpc.rs index 55be2a7e65..6ccfb8a69d 100644 --- a/crates/sdk/src/rpc.rs +++ b/crates/sdk/src/rpc.rs @@ -40,6 +40,7 @@ use namada_parameters::{storage as params_storage, EpochDuration}; use namada_proof_of_stake::parameters::PosParams; use namada_proof_of_stake::types::{ BondsAndUnbondsDetails, CommissionPair, ValidatorMetaData, + WeightedValidator, }; use namada_state::LastBlock; use namada_token::masp::MaspTokenRewardData; @@ -740,6 +741,19 @@ pub async fn get_all_validators( ) } +/// Get all consensus validators in the given epoch +pub async fn get_all_consensus_validators( + client: &C, + epoch: Epoch, +) -> Result, error::Error> { + convert_response::( + RPC.vp() + .pos() + .consensus_validator_set(client, &Some(epoch)) + .await, + ) +} + /// Get the total staked tokens in the given epoch pub async fn get_total_staked_tokens( client: &C,