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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
pub mod state {
use cw_controllers::Admin;
use cw_storage_plus::Map;
use crate::objects::{module::ModuleInfo, module_reference::ModuleReference};
use super::Core;
pub const ADMIN: Admin = Admin::new("admin");
pub const FACTORY: Admin = Admin::new("factory");
pub const MODULE_LIBRARY: Map<ModuleInfo, ModuleReference> = Map::new("module_lib");
pub const OS_ADDRESSES: Map<u32, Core> = Map::new("os_core");
}
use cosmwasm_schema::QueryResponses;
use cosmwasm_std::Addr;
use crate::objects::{
module::{Module, ModuleInfo},
module_reference::ModuleReference,
};
#[cosmwasm_schema::cw_serde]
pub struct Core {
pub manager: Addr,
pub proxy: Addr,
}
#[cosmwasm_schema::cw_serde]
pub struct InstantiateMsg {}
#[cosmwasm_schema::cw_serde]
pub enum ExecuteMsg {
RemoveModule { module: ModuleInfo },
AddModules {
modules: Vec<(ModuleInfo, ModuleReference)>,
},
AddOs { os_id: u32, core: Core },
SetAdmin { new_admin: String },
SetFactory { new_factory: String },
}
#[cosmwasm_schema::cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
#[returns(OsCoreResponse)]
OsCore { os_id: u32 },
#[returns(ModuleResponse)]
Module { module: ModuleInfo },
#[returns(ConfigResponse)]
Config {},
#[returns(ModulesResponse)]
Modules {
page_token: Option<ModuleInfo>,
page_size: Option<u8>,
},
}
#[cosmwasm_schema::cw_serde]
pub struct OsCoreResponse {
pub os_core: Core,
}
#[cosmwasm_schema::cw_serde]
pub struct ModuleResponse {
pub module: Module,
}
#[cosmwasm_schema::cw_serde]
pub struct ModulesResponse {
pub modules: Vec<(ModuleInfo, ModuleReference)>,
}
#[cosmwasm_schema::cw_serde]
pub struct ConfigResponse {
pub admin: String,
pub factory: String,
}
#[cosmwasm_schema::cw_serde]
pub struct MigrateMsg {}