Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
chore: implement newly added methods by ibc-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Farhad-Shabani committed Nov 27, 2023
1 parent 1aac601 commit 8b07a56
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions modules/sov-ibc/src/clients/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,17 @@ impl<'a, C: Context, Da: DaSpec> ClientExecutionContext for IbcContext<'a, C, Da
Ok(())
}

fn delete_consensus_state(
&mut self,
consensus_state_path: ClientConsensusStatePath,
) -> Result<(), ContextError> {
self.ibc
.consensus_state_map
.remove(&consensus_state_path, &mut self.working_set.borrow_mut());

Ok(())
}

fn store_update_time(
&mut self,
client_id: ClientId,
Expand Down Expand Up @@ -304,27 +315,26 @@ impl<'a, C: Context, Da: DaSpec> ClientExecutionContext for IbcContext<'a, C, Da
Ok(())
}

fn delete_consensus_state(
&mut self,
consensus_state_path: ClientConsensusStatePath,
) -> Result<(), ContextError> {
todo!()
}

fn delete_update_time(
&mut self,
client_id: ClientId,
height: Height,
) -> Result<(), ContextError> {
todo!()
self.ibc
.client_update_host_times_map
.remove(&(client_id, height), *self.working_set.borrow_mut());
Ok(())
}

fn delete_update_height(
&mut self,
client_id: ClientId,
height: Height,
) -> Result<(), ContextError> {
todo!()
self.ibc
.client_update_host_heights_map
.remove(&(client_id, height), *self.working_set.borrow_mut());
Ok(())
}
}

Expand All @@ -347,8 +357,13 @@ impl<'a, C: Context, Da: DaSpec> TmCommonContext for IbcContext<'a, C, Da> {
<Self as ValidationContext>::consensus_state(self, client_cons_state_path)
}

fn consensus_state_heights(&self, client_id: &ClientId) -> Result<Vec<Height>, ContextError> {
todo!()
fn consensus_state_heights(&self, _client_id: &ClientId) -> Result<Vec<Height>, ContextError> {
let heights = self
.ibc
.client_update_heights_vec
.iter(*self.working_set.borrow_mut())
.collect::<Vec<_>>();
Ok(heights)
}
}

Expand Down

0 comments on commit 8b07a56

Please sign in to comment.