diff --git a/crates/sdk/src/rpc.rs b/crates/sdk/src/rpc.rs index 44a2ab554a4..4c2d74f6135 100644 --- a/crates/sdk/src/rpc.rs +++ b/crates/sdk/src/rpc.rs @@ -39,6 +39,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_tx::data::{BatchedTxResult, DryRunResult, ResultCode, TxResult}; @@ -733,6 +734,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,