Skip to content

Commit

Permalink
added missing rpc queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianmarco Fraccaroli committed Jan 8, 2024
1 parent d636c07 commit 09796a7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions sdk/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use namada_core::ledger::governance::utils::Vote;
use namada_core::ledger::ibc::storage::{
ibc_denom_key, ibc_denom_key_prefix, is_ibc_denom_key,
};
use namada_core::ledger::pgf::storage::steward::StewardDetail;
use namada_core::ledger::storage::LastBlock;
use namada_core::types::account::Account;
use namada_core::types::address::{Address, InternalAddress};
Expand Down Expand Up @@ -223,6 +224,27 @@ pub async fn has_bonds<C: crate::queries::Client + Sync>(
convert_response::<C, bool>(RPC.vp().pos().has_bonds(client, source).await)
}

/// Get the set of pgf stewards
pub async fn query_pgf_stewards<C: crate::queries::Client + Sync>(
client: &C,
) -> Result<Vec<StewardDetail>, error::Error> {
convert_response::<C, Vec<StewardDetail>>(
RPC.vp().pgf().stewards(client).await,
)
}

/// Query the consensus key by validator address
pub async fn query_validator_consensus_keys<
C: crate::queries::Client + Sync,
>(
client: &C,
address: &Address,
) -> Result<Option<common::PublicKey>, error::Error> {
convert_response::<C, Option<common::PublicKey>>(
RPC.vp().pos().consensus_key(client, address).await,
)
}

/// Get the set of consensus keys registered in the network
pub async fn get_consensus_keys<C: crate::queries::Client + Sync>(
client: &C,
Expand Down

0 comments on commit 09796a7

Please sign in to comment.