#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextProposal {
#[prost(string, tag="1")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub description: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Deposit {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
#[prost(string, tag="2")]
pub depositor: ::prost::alloc::string::String,
#[prost(message, repeated, tag="3")]
pub amount: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Proposal {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
#[prost(message, optional, tag="2")]
pub content: ::core::option::Option<::prost_types::Any>,
#[prost(enumeration="ProposalStatus", tag="3")]
pub status: i32,
#[prost(message, optional, tag="4")]
pub final_tally_result: ::core::option::Option<TallyResult>,
#[prost(message, optional, tag="5")]
pub submit_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag="6")]
pub deposit_end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag="7")]
pub total_deposit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
#[prost(message, optional, tag="8")]
pub voting_start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag="9")]
pub voting_end_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TallyResult {
#[prost(string, tag="1")]
pub yes: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub abstain: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub no: ::prost::alloc::string::String,
#[prost(string, tag="4")]
pub no_with_veto: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Vote {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
#[prost(string, tag="2")]
pub voter: ::prost::alloc::string::String,
#[prost(enumeration="VoteOption", tag="3")]
pub option: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DepositParams {
#[prost(message, repeated, tag="1")]
pub min_deposit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
#[prost(message, optional, tag="2")]
pub max_deposit_period: ::core::option::Option<::prost_types::Duration>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VotingParams {
#[prost(message, optional, tag="1")]
pub voting_period: ::core::option::Option<::prost_types::Duration>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TallyParams {
#[prost(bytes="vec", tag="1")]
pub quorum: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="2")]
pub threshold: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="3")]
pub veto_threshold: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VoteOption {
Unspecified = 0,
Yes = 1,
Abstain = 2,
No = 3,
NoWithVeto = 4,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProposalStatus {
Unspecified = 0,
DepositPeriod = 1,
VotingPeriod = 2,
Passed = 3,
Rejected = 4,
Failed = 5,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgSubmitProposal {
#[prost(message, optional, tag="1")]
pub content: ::core::option::Option<::prost_types::Any>,
#[prost(message, repeated, tag="2")]
pub initial_deposit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
#[prost(string, tag="3")]
pub proposer: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgSubmitProposalResponse {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgVote {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
#[prost(string, tag="2")]
pub voter: ::prost::alloc::string::String,
#[prost(enumeration="VoteOption", tag="3")]
pub option: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgVoteResponse {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgDeposit {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
#[prost(string, tag="2")]
pub depositor: ::prost::alloc::string::String,
#[prost(message, repeated, tag="3")]
pub amount: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgDepositResponse {
}
# [doc = r" Generated client implementations."] pub mod msg_client { # ! [allow (unused_variables , dead_code , missing_docs)] use tonic :: codegen :: * ; # [doc = " Msg defines the bank Msg service."] pub struct MsgClient < T > { inner : tonic :: client :: Grpc < T > , } impl MsgClient < tonic :: transport :: Channel > { # [doc = r" Attempt to create a new client by connecting to a given endpoint."] pub async fn connect < D > (dst : D) -> Result < Self , tonic :: transport :: Error > where D : std :: convert :: TryInto < tonic :: transport :: Endpoint > , D :: Error : Into < StdError > , { let conn = tonic :: transport :: Endpoint :: new (dst) ? . connect () . await ? ; Ok (Self :: new (conn)) } } impl < T > MsgClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new (inner : T) -> Self { let inner = tonic :: client :: Grpc :: new (inner) ; Self { inner } } pub fn with_interceptor (inner : T , interceptor : impl Into < tonic :: Interceptor >) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor (inner , interceptor) ; Self { inner } } # [doc = " SubmitProposal defines a method to create new proposal given a content."] pub async fn submit_proposal (& mut self , request : impl tonic :: IntoRequest < super :: MsgSubmitProposal > ,) -> Result < tonic :: Response < super :: MsgSubmitProposalResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Msg/SubmitProposal") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Vote defines a method to add a vote on a specific proposal."] pub async fn vote (& mut self , request : impl tonic :: IntoRequest < super :: MsgVote > ,) -> Result < tonic :: Response < super :: MsgVoteResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Msg/Vote") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Deposit defines a method to add deposit on a specific proposal."] pub async fn deposit (& mut self , request : impl tonic :: IntoRequest < super :: MsgDeposit > ,) -> Result < tonic :: Response < super :: MsgDepositResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Msg/Deposit") ; self . inner . unary (request . into_request () , path , codec) . await } } impl < T : Clone > Clone for MsgClient < T > { fn clone (& self) -> Self { Self { inner : self . inner . clone () , } } } impl < T > std :: fmt :: Debug for MsgClient < T > { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { write ! (f , "MsgClient {{ ... }}") } } }
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryProposalRequest {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryProposalResponse {
#[prost(message, optional, tag="1")]
pub proposal: ::core::option::Option<Proposal>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryProposalsRequest {
#[prost(enumeration="ProposalStatus", tag="1")]
pub proposal_status: i32,
#[prost(string, tag="2")]
pub voter: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub depositor: ::prost::alloc::string::String,
#[prost(message, optional, tag="4")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryProposalsResponse {
#[prost(message, repeated, tag="1")]
pub proposals: ::prost::alloc::vec::Vec<Proposal>,
#[prost(message, optional, tag="2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryVoteRequest {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
#[prost(string, tag="2")]
pub voter: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryVoteResponse {
#[prost(message, optional, tag="1")]
pub vote: ::core::option::Option<Vote>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryVotesRequest {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
#[prost(message, optional, tag="2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryVotesResponse {
#[prost(message, repeated, tag="1")]
pub votes: ::prost::alloc::vec::Vec<Vote>,
#[prost(message, optional, tag="2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsRequest {
#[prost(string, tag="1")]
pub params_type: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsResponse {
#[prost(message, optional, tag="1")]
pub voting_params: ::core::option::Option<VotingParams>,
#[prost(message, optional, tag="2")]
pub deposit_params: ::core::option::Option<DepositParams>,
#[prost(message, optional, tag="3")]
pub tally_params: ::core::option::Option<TallyParams>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDepositRequest {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
#[prost(string, tag="2")]
pub depositor: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDepositResponse {
#[prost(message, optional, tag="1")]
pub deposit: ::core::option::Option<Deposit>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDepositsRequest {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
#[prost(message, optional, tag="2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDepositsResponse {
#[prost(message, repeated, tag="1")]
pub deposits: ::prost::alloc::vec::Vec<Deposit>,
#[prost(message, optional, tag="2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryTallyResultRequest {
#[prost(uint64, tag="1")]
pub proposal_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryTallyResultResponse {
#[prost(message, optional, tag="1")]
pub tally: ::core::option::Option<TallyResult>,
}
# [doc = r" Generated client implementations."] pub mod query_client { # ! [allow (unused_variables , dead_code , missing_docs)] use tonic :: codegen :: * ; # [doc = " Query defines the gRPC querier service for gov module"] pub struct QueryClient < T > { inner : tonic :: client :: Grpc < T > , } impl QueryClient < tonic :: transport :: Channel > { # [doc = r" Attempt to create a new client by connecting to a given endpoint."] pub async fn connect < D > (dst : D) -> Result < Self , tonic :: transport :: Error > where D : std :: convert :: TryInto < tonic :: transport :: Endpoint > , D :: Error : Into < StdError > , { let conn = tonic :: transport :: Endpoint :: new (dst) ? . connect () . await ? ; Ok (Self :: new (conn)) } } impl < T > QueryClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new (inner : T) -> Self { let inner = tonic :: client :: Grpc :: new (inner) ; Self { inner } } pub fn with_interceptor (inner : T , interceptor : impl Into < tonic :: Interceptor >) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor (inner , interceptor) ; Self { inner } } # [doc = " Proposal queries proposal details based on ProposalID."] pub async fn proposal (& mut self , request : impl tonic :: IntoRequest < super :: QueryProposalRequest > ,) -> Result < tonic :: Response < super :: QueryProposalResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Query/Proposal") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Proposals queries all proposals based on given status."] pub async fn proposals (& mut self , request : impl tonic :: IntoRequest < super :: QueryProposalsRequest > ,) -> Result < tonic :: Response < super :: QueryProposalsResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Query/Proposals") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Vote queries voted information based on proposalID, voterAddr."] pub async fn vote (& mut self , request : impl tonic :: IntoRequest < super :: QueryVoteRequest > ,) -> Result < tonic :: Response < super :: QueryVoteResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Query/Vote") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Votes queries votes of a given proposal."] pub async fn votes (& mut self , request : impl tonic :: IntoRequest < super :: QueryVotesRequest > ,) -> Result < tonic :: Response < super :: QueryVotesResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Query/Votes") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Params queries all parameters of the gov module."] pub async fn params (& mut self , request : impl tonic :: IntoRequest < super :: QueryParamsRequest > ,) -> Result < tonic :: Response < super :: QueryParamsResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Query/Params") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Deposit queries single deposit information based proposalID, depositAddr."] pub async fn deposit (& mut self , request : impl tonic :: IntoRequest < super :: QueryDepositRequest > ,) -> Result < tonic :: Response < super :: QueryDepositResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Query/Deposit") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Deposits queries all deposits of a single proposal."] pub async fn deposits (& mut self , request : impl tonic :: IntoRequest < super :: QueryDepositsRequest > ,) -> Result < tonic :: Response < super :: QueryDepositsResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Query/Deposits") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " TallyResult queries the tally of a proposal vote."] pub async fn tally_result (& mut self , request : impl tonic :: IntoRequest < super :: QueryTallyResultRequest > ,) -> Result < tonic :: Response < super :: QueryTallyResultResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/cosmos.gov.v1beta1.Query/TallyResult") ; self . inner . unary (request . into_request () , path , codec) . await } } impl < T : Clone > Clone for QueryClient < T > { fn clone (& self) -> Self { Self { inner : self . inner . clone () , } } } impl < T > std :: fmt :: Debug for QueryClient < T > { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { write ! (f , "QueryClient {{ ... }}") } } }
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
#[prost(uint64, tag="1")]
pub starting_proposal_id: u64,
#[prost(message, repeated, tag="2")]
pub deposits: ::prost::alloc::vec::Vec<Deposit>,
#[prost(message, repeated, tag="3")]
pub votes: ::prost::alloc::vec::Vec<Vote>,
#[prost(message, repeated, tag="4")]
pub proposals: ::prost::alloc::vec::Vec<Proposal>,
#[prost(message, optional, tag="5")]
pub deposit_params: ::core::option::Option<DepositParams>,
#[prost(message, optional, tag="6")]
pub voting_params: ::core::option::Option<VotingParams>,
#[prost(message, optional, tag="7")]
pub tally_params: ::core::option::Option<TallyParams>,
}