dao_proposal_multiple/
query.rs

1use crate::{proposal::MultipleChoiceProposal, state::Config};
2use cosmwasm_schema::cw_serde;
3use cosmwasm_std::{Addr, Uint128};
4
5use dao_voting::multiple_choice::MultipleChoiceVote;
6
7#[cw_serde]
8pub struct ProposalListResponse {
9    pub proposals: Vec<ProposalResponse>,
10}
11
12/// Information about a proposal returned by proposal queries.
13#[cw_serde]
14pub struct ProposalResponse {
15    pub id: u64,
16    pub proposal: MultipleChoiceProposal,
17}
18
19/// Information about a vote that was cast.
20#[cw_serde]
21pub struct VoteInfo {
22    /// The address that voted.
23    pub voter: Addr,
24    /// Position on the vote.
25    pub vote: MultipleChoiceVote,
26    /// The voting power behind the vote.
27    pub power: Uint128,
28    /// The rationale behind the vote.
29    pub rationale: Option<String>,
30}
31
32#[cw_serde]
33pub struct VoteResponse {
34    pub vote: Option<VoteInfo>,
35}
36
37#[cw_serde]
38pub struct VoteListResponse {
39    pub votes: Vec<VoteInfo>,
40}
41
42#[cw_serde]
43pub struct VoterResponse {
44    pub weight: Option<Uint128>,
45}
46
47#[cw_serde]
48pub struct ConfigResponse {
49    pub config: Config,
50}