Skip to content

Commit

Permalink
imp: fix timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed Jul 30, 2024
1 parent f933e1c commit 9f6c7d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/shared/src/utils/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ use crate::types::error::ContractError;
/// Returns an error if the timeout is not a timestamp or if the timestamp is in the past.
pub fn validate(env: &Env, timeout: &IbcTimeout) -> Result<(), ContractError> {
timeout.block().map_or(Ok(()), |b| {
if b.height == 0 && b.revision == 0 {
// This is a special case where the timeout is not set.
return Ok(());
}

if env.block.height >= b.height {
return Err(ContractError::invalid_timeout_block(
env.block.height,
Expand Down

0 comments on commit 9f6c7d7

Please sign in to comment.