use abstract_core::module_factory::*;
use boot_core::{Contract, CwEnv, TxResponse};
pub use abstract_core::module_factory::{
ExecuteMsgFns as MFactoryExecFns, QueryMsgFns as MFactoryQueryFns,
};
use boot_core::{contract, BootExecute};
#[contract(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct ModuleFactory<Chain>;
impl<Chain: CwEnv> ModuleFactory<Chain> {
pub fn new(name: &str, chain: Chain) -> Self {
let mut contract = Contract::new(name, chain);
contract = contract.with_wasm_path("abstract_module_factory");
Self(contract)
}
pub fn change_ans_host_addr(
&self,
mem_addr: String,
) -> Result<TxResponse<Chain>, crate::AbstractBootError> {
self.execute(
&ExecuteMsg::UpdateConfig {
admin: None,
ans_host_address: Some(mem_addr),
version_control_address: None,
},
None,
)
.map_err(Into::into)
}
}