1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
use cosmwasm_schema::{cw_serde, QueryResponses};
use cosmwasm_std::Uint128;
use cw2::ContractVersion;

#[cw_serde]
#[derive(QueryResponses)]
pub enum Query {
    /// Returns the token contract address, if set.
    #[returns(::cosmwasm_std::Addr)]
    TokenContract {},
    /// Returns the native token denom, if used.
    #[returns(DenomResponse)]
    Denom {},
    /// Returns the voting power for an address at a given height.
    #[returns(VotingPowerAtHeightResponse)]
    VotingPowerAtHeight {
        address: ::std::string::String,
        height: ::std::option::Option<::std::primitive::u64>,
    },
    /// Returns the total voting power at a given block heigh.
    #[returns(TotalPowerAtHeightResponse)]
    TotalPowerAtHeight {
        height: ::std::option::Option<::std::primitive::u64>,
    },
    /// Returns the address of the DAO this module belongs to.
    #[returns(cosmwasm_std::Addr)]
    Dao {},
    /// Returns contract version info.
    #[returns(InfoResponse)]
    Info {},
    /// Whether the DAO is active or not.
    #[returns(::std::primitive::bool)]
    IsActive {},
}

#[cw_serde]
pub enum ActiveThresholdQuery {
    ActiveThreshold {},
}

#[cw_serde]
pub struct VotingPowerAtHeightResponse {
    pub power: Uint128,
    pub height: u64,
}

#[cw_serde]
pub struct TotalPowerAtHeightResponse {
    pub power: Uint128,
    pub height: u64,
}

#[cw_serde]
pub struct InfoResponse {
    pub info: ContractVersion,
}

#[cw_serde]
pub struct IsActiveResponse {
    pub active: bool,
}

#[cw_serde]
pub struct DenomResponse {
    pub denom: String,
}