Skip to content

Commit

Permalink
Incorporate PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchen1991 committed Oct 19, 2023
1 parent f0626df commit 1bd8588
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion crates/ibc/src/clients/ics07_tendermint/client_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ where

impl<E> ClientStateExecution<E> for ClientState
where
E: TmExecutionContext + ExecutionContext + TmValidationContext,
E: TmExecutionContext + ExecutionContext,
<E as ClientExecutionContext>::AnyClientState: From<ClientState>,
<E as ClientExecutionContext>::AnyConsensusState: From<TmConsensusState>,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl ClientState {
client_id: &ClientId,
) -> Result<(), ClientError>
where
E: ClientExecutionContext + TmValidationContext,
E: ClientExecutionContext + CommonContext,
{
let mut heights = ctx.consensus_state_heights(client_id)?;

Expand All @@ -190,12 +190,12 @@ impl ClientState {
})?;

let host_timestamp = ctx.host_timestamp()?;
let tm_consensus_state_timestamp = (tm_consensus_state.timestamp() + self.trusting_period)
let tm_consensus_state_expiry = (tm_consensus_state.timestamp() + self.trusting_period)
.map_err(|_| ClientError::Other {
description: String::from("Timestamp overflow error occurred while attempting to parse TmConsensusState")
})?;

if tm_consensus_state_timestamp > host_timestamp {
if tm_consensus_state_expiry > host_timestamp {
break;
} else {
let client_id = client_id.clone();
Expand Down
36 changes: 18 additions & 18 deletions crates/ibc/src/core/ics02_client/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,6 @@ pub trait ClientExecutionContext: Sized {
consensus_state_path: ClientConsensusStatePath,
) -> Result<(), ContextError>;

/// Delete the update time associated with the client at the specified height. This update
/// time should be associated with a consensus state through the specified height.
///
/// Note that this timestamp is determined by the host.
fn delete_update_time(
&mut self,
client_id: ClientId,
height: Height,
) -> Result<(), ContextError>;

/// Delete the update height associated with the client at the specified height. This update
/// time should be associated with a consensus state through the specified height.
fn delete_update_height(
&mut self,
client_id: ClientId,
height: Height,
) -> Result<(), ContextError>;

/// Called upon successful client update.
/// Implementations are expected to use this to record the specified time as the time at which
/// this update (or header) was processed.
Expand All @@ -96,4 +78,22 @@ pub trait ClientExecutionContext: Sized {
height: Height,
host_height: Height,
) -> Result<(), ContextError>;

/// Delete the update time associated with the client at the specified height. This update
/// time should be associated with a consensus state through the specified height.
///
/// Note that this timestamp is determined by the host.
fn delete_update_time(
&mut self,
client_id: ClientId,
height: Height,
) -> Result<(), ContextError>;

/// Delete the update height associated with the client at the specified height. This update
/// time should be associated with a consensus state through the specified height.
fn delete_update_height(
&mut self,
client_id: ClientId,
height: Height,
) -> Result<(), ContextError>;
}

0 comments on commit 1bd8588

Please sign in to comment.