Skip to content

Commit

Permalink
added pgf parameters rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianmarco Fraccaroli committed Jan 16, 2024
1 parent c3cd932 commit c90ac1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 1 addition & 2 deletions apps/src/lib/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,8 +1167,7 @@ pub async fn query_proposal_result(
)
.await;

let proposal_result = if let Ok(Some(proposal_result)) = proposal_result
{
if let Ok(Some(proposal_result)) = proposal_result {
display_line!(context.io(), "Proposal Id: {} ", proposal_id);
display_line!(context.io(), "{:4}{}", "", proposal_result);
} else {
Expand Down
15 changes: 11 additions & 4 deletions sdk/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ use masp_primitives::sapling::Node;
use namada_core::ledger::governance::parameters::GovernanceParameters;
use namada_core::ledger::governance::storage::proposal::StorageProposal;
use namada_core::ledger::governance::utils::{
compute_proposal_result, ProposalResult, ProposalVotes, TallyVote, Vote,
VotePower,
compute_proposal_result, ProposalResult, ProposalVotes, Vote,
};
use namada_core::ledger::ibc::storage::{
ibc_denom_key, ibc_denom_key_prefix, is_ibc_denom_key,
};
use namada_core::ledger::pgf::parameters::PgfParameters;
use namada_core::ledger::pgf::storage::steward::StewardDetail;
use namada_core::ledger::storage::LastBlock;
use namada_core::types::account::Account;
Expand Down Expand Up @@ -1094,14 +1094,21 @@ pub async fn query_unbond_with_slashing<C: crate::queries::Client + Sync>(
)
}

/// Get the givernance parameters
/// Get the governance parameters
pub async fn query_governance_parameters<C: crate::queries::Client + Sync>(
client: &C,
) -> GovernanceParameters {
unwrap_client_response::<C, _>(RPC.vp().gov().parameters(client).await)
}

/// Get the givernance parameters
/// Get the public good fundings parameters
pub async fn query_pgf_parameters<C: crate::queries::Client + Sync>(
client: &C,
) -> PgfParameters {
unwrap_client_response::<C, _>(RPC.vp().pgf().parameters(client).await)
}

/// Get all the votes of a proposal
pub async fn query_proposal_votes<C: crate::queries::Client + Sync>(
client: &C,
proposal_id: u64,
Expand Down

0 comments on commit c90ac1c

Please sign in to comment.