cw_core/helpers.rs
1use cosmwasm_std::{Addr, WasmMsg};
2
3use crate::msg::{Admin, ModuleInstantiateInfo};
4
5impl ModuleInstantiateInfo {
6 pub fn into_wasm_msg(self, contract_address: Addr) -> WasmMsg {
7 WasmMsg::Instantiate {
8 admin: match self.admin {
9 Admin::Address { addr } => Some(addr),
10 Admin::CoreContract {} => Some(contract_address.to_string()),
11 Admin::None {} => None,
12 },
13 code_id: self.code_id,
14 msg: self.msg,
15 funds: vec![],
16 label: self.label,
17 }
18 }
19}