@@ -8,7 +8,7 @@ use cw_light_client_common::traits::IQueryHandler;
8
8
use crate :: mock_client:: MockClient ;
9
9
use crate :: query_handler:: QueryHandler ;
10
10
11
- use common:: icon:: icon:: types:: v1:: { MerkleNode , MerkleProofs , SignedHeader } ;
11
+ use common:: icon:: icon:: types:: v1:: { MerkleProofs , SignedHeader } ;
12
12
13
13
#[ cfg( not( feature = "library" ) ) ]
14
14
use cosmwasm_std:: entry_point;
@@ -19,7 +19,7 @@ use cw_common::raw_types::Any;
19
19
20
20
use crate :: context:: CwContext ;
21
21
use crate :: light_client:: IconClient ;
22
- use crate :: msg:: { ContractResult , ExecuteMsg , InstantiateMsg , QueryMsg } ;
22
+ use crate :: msg:: { ContractResult , ExecuteMsg , InstantiateMsg , QueryMsg , QueryResponse } ;
23
23
use crate :: traits:: { IContext , ILightClient } ;
24
24
use crate :: ContractError ;
25
25
use prost:: Message ;
@@ -71,9 +71,9 @@ fn process_message(
71
71
let client_id = "08-wasm-0" ;
72
72
let proofs_decoded =
73
73
MerkleProofs :: decode ( msg. proof . as_slice ( ) ) . map_err ( ContractError :: DecodeError ) ?;
74
- let path = hex:: decode ( & msg. path . key_path . join ( "" ) ) . unwrap ( ) ;
74
+ let path = hex:: decode ( msg. path . key_path . join ( "" ) ) . unwrap ( ) ;
75
75
76
- let ok = QueryHandler :: verify_membership (
76
+ let _ok = QueryHandler :: verify_membership (
77
77
deps_mut. as_ref ( ) ,
78
78
client_id,
79
79
height,
@@ -92,7 +92,7 @@ fn process_message(
92
92
let client_id = "08-wasm-0" ;
93
93
let proofs_decoded =
94
94
MerkleProofs :: decode ( msg. proof . as_slice ( ) ) . map_err ( ContractError :: DecodeError ) ?;
95
- let path = hex:: decode ( & msg. path . key_path . join ( "" ) ) . unwrap ( ) ;
95
+ let path = hex:: decode ( msg. path . key_path . join ( "" ) ) . unwrap ( ) ;
96
96
97
97
let _ok = QueryHandler :: verify_non_membership (
98
98
deps_mut. as_ref ( ) ,
@@ -166,11 +166,15 @@ pub fn any_from_byte(bytes: &[u8]) -> Result<Any, ContractError> {
166
166
}
167
167
168
168
#[ cfg_attr( not( feature = "library" ) , entry_point) ]
169
- pub fn query ( _deps : Deps , _env : Env , msg : QueryMsg ) -> StdResult < Binary > {
169
+ pub fn query ( deps : Deps , _env : Env , msg : QueryMsg ) -> StdResult < Binary > {
170
+ let client_id = "08-wasm-0" ;
170
171
match msg {
171
172
QueryMsg :: ClientTypeMsg ( _) => todo ! ( ) ,
172
173
QueryMsg :: GetLatestHeightsMsg ( _) => todo ! ( ) ,
173
- QueryMsg :: ExportMetadata ( _) => todo ! ( ) ,
174
+ QueryMsg :: ExportMetadata ( _) => {
175
+ let res = QueryHandler :: get_genesis_metadata ( deps. storage , client_id) ;
176
+ to_binary ( & QueryResponse :: genesis_metadata ( Some ( res) ) )
177
+ }
174
178
QueryMsg :: Status ( _) => todo ! ( ) ,
175
179
}
176
180
}
0 commit comments