Skip to content

Commit

Permalink
rm Clone bound
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Apr 28, 2024
1 parent f52197c commit 4cdb0e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ibc-clients/cw-context/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Context<'a, Self>> + Clone;
type ClientState: ClientStateExecution<Context<'a, Self>>;
type ConsensusState: ConsensusStateTrait + Into<Any> + TryFrom<Any, Error = ClientError>;
}
2 changes: 1 addition & 1 deletion ibc-clients/cw-context/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ impl<'a, C: ClientType<'a>> Context<'a, C> {
client_state: C::ClientState,
) -> Result<Vec<u8>, 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())
Expand Down
6 changes: 4 additions & 2 deletions ibc-clients/cw-context/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)?;

Expand Down

0 comments on commit 4cdb0e9

Please sign in to comment.