Skip to main content

marbu_customization_module/
msg.rs

1use cosmwasm_schema::{cw_serde, QueryResponses};
2use cosmwasm_std::Binary;
3
4use crate::state::{Config, Data};
5
6use komple_framework_types::shared::{execute::SharedExecuteMsg, query::ResponseWrapper};
7
8#[cw_serde]
9pub enum ExecuteMsg {
10    /// Set a single data entry
11    SetData { key: String, value: Binary },
12    /// Set multiple data entries
13    SetDataBatch { data: Vec<Data> },
14    /// Hub message.
15    ///
16    /// Lock the execute entry point.
17    /// Can only be called by the hub module.
18    LockExecute {},
19}
20
21impl From<ExecuteMsg> for SharedExecuteMsg {
22    fn from(msg: ExecuteMsg) -> Self {
23        match msg {
24            ExecuteMsg::LockExecute {} => SharedExecuteMsg::LockExecute {},
25            _ => unreachable!("Cannot convert {:?} to SharedExecuteMessage", msg),
26        }
27    }
28}
29
30#[cw_serde]
31#[derive(QueryResponses)]
32pub enum QueryMsg {
33    #[returns(ResponseWrapper<Config>)]
34    Config {},
35    // Get a single data entry
36    #[returns(ResponseWrapper<Option<Binary>>)]
37    GetData { key: String },
38    // Get multiple data entries by keys
39    #[returns(ResponseWrapper<Vec<Option<Binary>>>)]
40    GetDataBatch { keys: Vec<String> },
41    // Get all keys
42    #[returns(ResponseWrapper<Vec<String>>)]
43    ListKeys {},
44}
45
46#[cw_serde]
47pub struct MigrateMsg {}