1
1
use cosmwasm_std:: {
2
2
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 ,
4
4
} ;
5
5
6
6
use crate :: errors:: ContractError ;
@@ -13,9 +13,7 @@ pub fn instantiate(
13
13
_info : MessageInfo ,
14
14
_msg : InstantiateMsg ,
15
15
) -> StdResult < Response > {
16
- Err ( StdError :: generic_err (
17
- "You can only use this contract for migrations" ,
18
- ) )
16
+ Ok ( Response :: new ( ) )
19
17
}
20
18
21
19
#[ entry_point]
@@ -96,4 +94,18 @@ pub fn execute_spread(
96
94
}
97
95
98
96
#[ 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