@@ -15,7 +15,8 @@ impl<E> ClientStateExecution<E> for ClientState
1515where
1616 E : ExtClientExecutionContext ,
1717 E :: ClientStateRef : From < ClientStateType > ,
18- E :: ConsensusStateRef : Convertible < ConsensusStateType , ClientError > ,
18+ ConsensusStateType : Convertible < E :: ConsensusStateRef > ,
19+ <ConsensusStateType as TryFrom < E :: ConsensusStateRef > >:: Error : Into < ClientError > ,
1920{
2021 fn initialise (
2122 & self ,
@@ -93,12 +94,12 @@ pub fn initialise<E>(
9394where
9495 E : ExtClientExecutionContext ,
9596 E :: ClientStateRef : From < ClientStateType > ,
96- E :: ConsensusStateRef : Convertible < ConsensusStateType , ClientError > ,
97+ ConsensusStateType : Convertible < E :: ConsensusStateRef > ,
9798{
9899 let host_timestamp = ExtClientValidationContext :: host_timestamp ( ctx) ?;
99100 let host_height = ExtClientValidationContext :: host_height ( ctx) ?;
100101
101- let tm_consensus_state = ConsensusStateType :: try_from ( consensus_state) ?;
102+ let tm_consensus_state: ConsensusStateType = consensus_state. try_into ( ) ?;
102103
103104 ctx. store_client_state (
104105 ClientStatePath :: new ( client_id. clone ( ) ) ,
@@ -138,7 +139,8 @@ pub fn update_state<E>(
138139where
139140 E : ExtClientExecutionContext ,
140141 E :: ClientStateRef : From < ClientStateType > ,
141- E :: ConsensusStateRef : Convertible < ConsensusStateType , ClientError > ,
142+ ConsensusStateType : Convertible < E :: ConsensusStateRef > ,
143+ <ConsensusStateType as TryFrom < E :: ConsensusStateRef > >:: Error : Into < ClientError > ,
142144{
143145 let header = TmHeader :: try_from ( header) ?;
144146 let header_height = header. height ( ) ;
@@ -237,10 +239,10 @@ pub fn update_on_upgrade<E>(
237239where
238240 E : ExtClientExecutionContext ,
239241 E :: ClientStateRef : From < ClientStateType > ,
240- E :: ConsensusStateRef : Convertible < ConsensusStateType , ClientError > ,
242+ ConsensusStateType : Convertible < E :: ConsensusStateRef > ,
241243{
242244 let mut upgraded_tm_client_state = ClientState :: try_from ( upgraded_client_state) ?;
243- let upgraded_tm_cons_state = ConsensusStateType :: try_from ( upgraded_consensus_state) ?;
245+ let upgraded_tm_cons_state: ConsensusStateType = upgraded_consensus_state. try_into ( ) ?;
244246
245247 upgraded_tm_client_state. 0 . zero_custom_fields ( ) ;
246248
@@ -317,7 +319,8 @@ pub fn prune_oldest_consensus_state<E>(
317319where
318320 E : ClientExecutionContext + ExtClientValidationContext ,
319321 E :: ClientStateRef : From < ClientStateType > ,
320- E :: ConsensusStateRef : Convertible < ConsensusStateType , ClientError > ,
322+ ConsensusStateType : Convertible < E :: ConsensusStateRef > ,
323+ <ConsensusStateType as TryFrom < E :: ConsensusStateRef > >:: Error : Into < ClientError > ,
321324{
322325 let mut heights = ctx. consensus_state_heights ( client_id) ?;
323326
@@ -330,7 +333,8 @@ where
330333 height. revision_height ( ) ,
331334 ) ;
332335 let consensus_state = ctx. consensus_state ( & client_consensus_state_path) ?;
333- let tm_consensus_state = consensus_state. try_into ( ) ?;
336+ let tm_consensus_state: ConsensusStateType =
337+ consensus_state. try_into ( ) . map_err ( Into :: into) ?;
334338
335339 let host_timestamp =
336340 ctx. host_timestamp ( ) ?
@@ -380,7 +384,7 @@ pub fn update_on_recovery<E>(
380384where
381385 E : ExtClientExecutionContext ,
382386 E :: ClientStateRef : From < ClientStateType > ,
383- E :: ConsensusStateRef : Convertible < ConsensusStateType , ClientError > ,
387+ ConsensusStateType : Convertible < E :: ConsensusStateRef > ,
384388{
385389 let substitute_client_state = ClientState :: try_from ( substitute_client_state) ?
386390 . inner ( )
@@ -401,7 +405,7 @@ where
401405 let host_timestamp = E :: host_timestamp ( ctx) ?;
402406 let host_height = E :: host_height ( ctx) ?;
403407
404- let tm_consensus_state = ConsensusStateType :: try_from ( substitute_consensus_state) ?;
408+ let tm_consensus_state: ConsensusStateType = substitute_consensus_state. try_into ( ) ?;
405409
406410 ctx. store_consensus_state (
407411 ClientConsensusStatePath :: new (
0 commit comments