dao_pre_propose_approver/
msg.rs

1use cosmwasm_schema::{cw_serde, QueryResponses};
2use cosmwasm_std::{CosmosMsg, Empty};
3use dao_pre_propose_base::msg::{
4    ExecuteMsg as ExecuteBase, InstantiateMsg as InstantiateBase, MigrateMsg as MigrateBase,
5    QueryMsg as QueryBase,
6};
7use dao_voting::approval::ApproverProposeMessage;
8
9#[cw_serde]
10pub struct InstantiateMsg {
11    pub pre_propose_approval_contract: String,
12}
13
14#[cw_serde]
15pub enum ExecuteExt {
16    // Reset approver back to DAO that set up this approver contract. Only
17    // callable by the DAO.
18    ResetApprover {},
19}
20
21#[cw_serde]
22#[derive(QueryResponses)]
23pub enum QueryExt {
24    #[returns(cosmwasm_std::Addr)]
25    PreProposeApprovalContract {},
26    #[returns(::std::option::Option<u64>)]
27    PreProposeApprovalIdForApproverProposalId { id: u64 },
28    #[returns(::std::option::Option<u64>)]
29    ApproverProposalIdForPreProposeApprovalId { id: u64 },
30}
31
32pub type BaseInstantiateMsg = InstantiateBase<Empty>;
33pub type ExecuteMsg = ExecuteBase<ApproverProposeMessage, ExecuteExt>;
34pub type QueryMsg = QueryBase<QueryExt>;
35pub type MigrateMsg = MigrateBase<Empty>;
36
37/// Internal version of the propose message that includes the
38/// `proposer` field. The module will fill this in based on the sender
39/// of the external message.
40#[cw_serde]
41pub enum ProposeMessageInternal {
42    Propose {
43        title: String,
44        description: String,
45        msgs: Vec<CosmosMsg<Empty>>,
46        proposer: Option<String>,
47    },
48}