11use cosmwasm_std:: {
22 entry_point, instantiate2_address, to_binary, Attribute , Binary , CodeInfoResponse ,
3- ContractInfoResponse , DepsMut , Env , MessageInfo , Response , StdError , StdResult , WasmMsg ,
3+ ContractInfoResponse , DepsMut , Env , MessageInfo , Response , StdResult , WasmMsg ,
44} ;
55
66use crate :: errors:: ContractError ;
@@ -13,9 +13,7 @@ pub fn instantiate(
1313 _info : MessageInfo ,
1414 _msg : InstantiateMsg ,
1515) -> StdResult < Response > {
16- Err ( StdError :: generic_err (
17- "You can only use this contract for migrations" ,
18- ) )
16+ Ok ( Response :: new ( ) )
1917}
2018
2119#[ entry_point]
@@ -96,4 +94,18 @@ pub fn execute_spread(
9694}
9795
9896#[ cfg( test) ]
99- mod tests { }
97+ mod tests {
98+ use super :: * ;
99+ use cosmwasm_std:: testing:: { mock_dependencies, mock_env, mock_info} ;
100+
101+ const CREATOR : & str = "creator" ;
102+
103+ #[ test]
104+ fn instantiate_works ( ) {
105+ let mut deps = mock_dependencies ( ) ;
106+ let msg = InstantiateMsg { } ;
107+ let info = mock_info ( CREATOR , & [ ] ) ;
108+ let res = instantiate ( deps. as_mut ( ) , mock_env ( ) , info, msg) . unwrap ( ) ;
109+ assert_eq ! ( 0 , res. messages. len( ) ) ;
110+ }
111+ }
0 commit comments