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
use abstract_os::module_factory::*;
use boot_core::{BootEnvironment, BootError, Contract, TxResponse};
pub use abstract_os::module_factory::{
ExecuteMsgFns as MFactoryExecFns, QueryMsgFns as MFactoryQueryFns,
};
use boot_core::{interface::BootExecute, prelude::boot_contract};
#[boot_contract(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct ModuleFactory<Chain>;
impl<Chain: BootEnvironment> ModuleFactory<Chain> {
pub fn new(name: &str, chain: Chain) -> Self {
let mut contract = Contract::new(name, chain);
contract = contract.with_wasm_path("module_factory");
Self(contract)
}
pub fn change_ans_host_addr(&self, mem_addr: String) -> Result<TxResponse<Chain>, BootError> {
self.execute(
&ExecuteMsg::UpdateConfig {
admin: None,
ans_host_address: Some(mem_addr),
version_control_address: None,
},
None,
)
}
}