@@ -23,8 +23,7 @@ use crate::executor::AppResponse;
23
23
use crate :: transactions:: transactional;
24
24
use cosmwasm_std:: testing:: mock_wasmd_attr;
25
25
26
- use anyhow:: { anyhow, bail, Result as AnyResult } ;
27
- use cw0:: parse_instantiate_response_data;
26
+ use anyhow:: { bail, Result as AnyResult } ;
28
27
29
28
// Contract state is kept in Storage, separate from the contracts themselves
30
29
const CONTRACTS : Map < & Addr , ContractData > = Map :: new ( "contracts" ) ;
@@ -836,6 +835,8 @@ where
836
835
}
837
836
}
838
837
838
+ // TODO: replace with code in cw0
839
+
839
840
#[ derive( Clone , PartialEq , Message ) ]
840
841
pub struct InstantiateData {
841
842
#[ prost( string, tag = "1" ) ]
@@ -857,20 +858,6 @@ fn init_response(res: &mut AppResponse, contact_address: &Addr) {
857
858
res. data = Some ( new_data. into ( ) ) ;
858
859
}
859
860
860
- // this parses the result from a wasm contract init
861
- pub fn parse_contract_addr ( data : & Option < Binary > ) -> AnyResult < Addr > {
862
- let bin = data
863
- . as_ref ( )
864
- . ok_or_else ( || anyhow ! ( "No data response" ) ) ?
865
- . to_vec ( ) ;
866
- // parse the protobuf struct
867
- let init_data = parse_instantiate_response_data ( bin. as_slice ( ) ) ?;
868
- if init_data. contract_address . is_empty ( ) {
869
- bail ! ( "no contract address provided" ) ;
870
- }
871
- Ok ( Addr :: unchecked ( init_data. contract_address ) )
872
- }
873
-
874
861
#[ cfg( test) ]
875
862
mod test {
876
863
use cosmwasm_std:: testing:: { mock_env, mock_info, MockApi , MockQuerier , MockStorage } ;
0 commit comments