11#[ cfg( not( feature = "library" ) ) ]
22use cosmwasm_std:: entry_point;
33use cosmwasm_std:: {
4- instantiate2_address, to_binary , Binary , CodeInfoResponse , Deps , DepsMut , Env , MessageInfo ,
5- Response , StdError , StdResult , WasmMsg ,
4+ instantiate2_address, to_json_binary , Binary , CodeInfoResponse , Deps , DepsMut , Env ,
5+ MessageInfo , Response , StdError , StdResult , WasmMsg ,
66} ;
77use cw2:: set_contract_version;
88
@@ -55,7 +55,7 @@ pub fn instantiate(
5555 admin : Some ( env. contract . address . to_string ( ) ) ,
5656 code_id : msg. triplestore_config . code_id . u64 ( ) ,
5757 label : format ! ( "{}_triplestore" , msg. name) ,
58- msg : to_binary ( & okp4_cognitarium:: msg:: InstantiateMsg {
58+ msg : to_json_binary ( & okp4_cognitarium:: msg:: InstantiateMsg {
5959 limits : msg. triplestore_config . limits . into ( ) ,
6060 } ) ?,
6161 funds : vec ! [ ] ,
@@ -105,7 +105,7 @@ mod tests {
105105 )
106106 . unwrap ( ) ,
107107 ) ;
108- SystemResult :: Ok ( ContractResult :: Ok ( to_binary ( & resp) . unwrap ( ) ) )
108+ SystemResult :: Ok ( ContractResult :: Ok ( to_json_binary ( & resp) . unwrap ( ) ) )
109109 }
110110 _ => SystemResult :: Err ( SystemError :: Unknown { } ) ,
111111 } ) ;
@@ -123,7 +123,8 @@ mod tests {
123123 } ,
124124 } ;
125125
126- let res = instantiate ( deps. as_mut ( ) , mock_env ( ) , mock_info ( "creator" , & [ ] ) , msg) . unwrap ( ) ;
126+ let env = mock_env ( ) ;
127+ let res = instantiate ( deps. as_mut ( ) , env. clone ( ) , mock_info ( "creator" , & [ ] ) , msg) . unwrap ( ) ;
127128
128129 assert_eq ! (
129130 res. attributes,
@@ -132,10 +133,10 @@ mod tests {
132133 assert_eq ! (
133134 res. messages,
134135 vec![ SubMsg :: new( WasmMsg :: Instantiate2 {
135- admin: Some ( "cosmos2contract" . to_string( ) ) ,
136+ admin: Some ( env . contract . address . to_string( ) ) ,
136137 code_id: 17 ,
137138 label: "my-dataverse_triplestore" . to_string( ) ,
138- msg: to_binary ( & okp4_cognitarium:: msg:: InstantiateMsg {
139+ msg: to_json_binary ( & okp4_cognitarium:: msg:: InstantiateMsg {
139140 limits: store_limits. into( ) ,
140141 } )
141142 . unwrap( ) ,
0 commit comments