diff --git a/ibc-clients/cw-context/src/api.rs b/ibc-clients/cw-context/src/api.rs index cdab7a745..5877b190a 100644 --- a/ibc-clients/cw-context/src/api.rs +++ b/ibc-clients/cw-context/src/api.rs @@ -9,6 +9,6 @@ use crate::context::Context; /// their client state and consensus state types into the generic [`Context`] /// object. pub trait ClientType<'a>: Sized { - type ClientState: ClientStateExecution> + Clone; + type ClientState: ClientStateExecution>; type ConsensusState: ConsensusStateTrait + Into + TryFrom; } diff --git a/ibc-clients/cw-context/src/context/mod.rs b/ibc-clients/cw-context/src/context/mod.rs index 1000f837c..9b9b5f589 100644 --- a/ibc-clients/cw-context/src/context/mod.rs +++ b/ibc-clients/cw-context/src/context/mod.rs @@ -290,9 +290,9 @@ impl<'a, C: ClientType<'a>> Context<'a, C> { client_state: C::ClientState, ) -> Result, ClientError> { let wasm_client_state = WasmClientState { - data: C::ClientState::encode_to_any_vec(client_state.clone()), checksum: self.obtain_checksum()?, latest_height: client_state.latest_height(), + data: C::ClientState::encode_to_any_vec(client_state), }; Ok(Any::from(wasm_client_state).encode_to_vec()) diff --git a/ibc-clients/cw-context/src/handlers.rs b/ibc-clients/cw-context/src/handlers.rs index 024d8e08a..50aa1e03a 100644 --- a/ibc-clients/cw-context/src/handlers.rs +++ b/ibc-clients/cw-context/src/handlers.rs @@ -133,13 +133,15 @@ impl<'a, C: ClientType<'a>> Context<'a, C> { substitute_client_state.latest_height().revision_height(), ))?; + let substitute_client_state_any = substitute_client_state.into(); + self.set_subject_prefix(); - client_state.check_substitute(self, substitute_client_state.clone().into())?; + client_state.check_substitute(self, substitute_client_state_any.clone())?; client_state.update_on_recovery( self, &self.client_id(), - substitute_client_state.into(), + substitute_client_state_any, substitute_consensus_state.into(), )?;