pub struct GovClient { /* private fields */ }
Expand description
Client for interacting with the governance module in the Cosmos SDK.
Implementations§
Source§impl GovClient
impl GovClient
Sourcepub fn new(base_client: Arc<RwLock<BaseClient>>) -> Self
pub fn new(base_client: Arc<RwLock<BaseClient>>) -> Self
Sourcepub async fn get_proposal(
&mut self,
proposal_id: u64,
) -> Result<QueryProposalResponse>
pub async fn get_proposal( &mut self, proposal_id: u64, ) -> Result<QueryProposalResponse>
Queries a proposal based on proposal ID.
Sourcepub async fn get_proposals(
&mut self,
proposal_status: i32,
voter: String,
depositor: String,
) -> Result<QueryProposalsResponse>
pub async fn get_proposals( &mut self, proposal_status: i32, voter: String, depositor: String, ) -> Result<QueryProposalsResponse>
Queries all proposals based on given status.
Sourcepub async fn get_vote(
&mut self,
proposal_id: u64,
voter: String,
) -> Result<QueryVoteResponse>
pub async fn get_vote( &mut self, proposal_id: u64, voter: String, ) -> Result<QueryVoteResponse>
Queries voted information based on proposalID, voter address.
Sourcepub async fn get_votes(
&mut self,
proposal_id: u64,
) -> Result<QueryVotesResponse>
pub async fn get_votes( &mut self, proposal_id: u64, ) -> Result<QueryVotesResponse>
Queries votes of a given proposal.
Sourcepub async fn get_params(
&mut self,
params_type: String,
) -> Result<QueryParamsResponse>
pub async fn get_params( &mut self, params_type: String, ) -> Result<QueryParamsResponse>
Queries all parameters of the gov module.
Sourcepub async fn get_deposit(
&mut self,
proposal_id: u64,
depositor: String,
) -> Result<QueryDepositResponse>
pub async fn get_deposit( &mut self, proposal_id: u64, depositor: String, ) -> Result<QueryDepositResponse>
Queries single deposit information based on proposalID, depositor address.
Sourcepub async fn get_deposits(
&mut self,
proposal_id: u64,
) -> Result<QueryDepositsResponse>
pub async fn get_deposits( &mut self, proposal_id: u64, ) -> Result<QueryDepositsResponse>
Queries all deposits of a single proposal.
Sourcepub async fn get_tally_result(
&mut self,
proposal_id: u64,
) -> Result<QueryTallyResultResponse>
pub async fn get_tally_result( &mut self, proposal_id: u64, ) -> Result<QueryTallyResultResponse>
Queries the tally of a proposal vote.
Sourcepub async fn submit_proposal(
&mut self,
msg: MsgSubmitProposal,
) -> Result<MsgSubmitProposalResponse>
pub async fn submit_proposal( &mut self, msg: MsgSubmitProposal, ) -> Result<MsgSubmitProposalResponse>
Submits a proposal.
Sourcepub async fn vote(&mut self, msg: MsgVote) -> Result<MsgVoteResponse>
pub async fn vote(&mut self, msg: MsgVote) -> Result<MsgVoteResponse>
Casts a vote.
Sourcepub async fn vote_weighted(
&mut self,
msg: MsgVoteWeighted,
) -> Result<MsgVoteWeightedResponse>
pub async fn vote_weighted( &mut self, msg: MsgVoteWeighted, ) -> Result<MsgVoteWeightedResponse>
Casts a weighted vote. @TODO: Doesnt work because of no Name bound on the message type 🤔
Sourcepub async fn deposit(&mut self, msg: MsgDeposit) -> Result<MsgDepositResponse>
pub async fn deposit(&mut self, msg: MsgDeposit) -> Result<MsgDepositResponse>
Submits a deposit to an existing proposal.
Sourcepub async fn submit_software_upgrade(
&mut self,
proposer: &str,
upgrade_msg: MsgSoftwareUpgrade,
deposit: &str,
) -> Result<MsgSubmitProposalResponse>
pub async fn submit_software_upgrade( &mut self, proposer: &str, upgrade_msg: MsgSoftwareUpgrade, deposit: &str, ) -> Result<MsgSubmitProposalResponse>
Submits a software upgrade proposal.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GovClient
impl !RefUnwindSafe for GovClient
impl Send for GovClient
impl Sync for GovClient
impl Unpin for GovClient
impl !UnwindSafe for GovClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request