From 9f6c7d7048feef6fa503b1c290e94d01130e3478 Mon Sep 17 00:00:00 2001 From: srdtrk Date: Tue, 30 Jul 2024 18:41:08 +0900 Subject: [PATCH] imp: fix timeout --- packages/shared/src/utils/timeout.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/shared/src/utils/timeout.rs b/packages/shared/src/utils/timeout.rs index 08dab3b..96140ed 100644 --- a/packages/shared/src/utils/timeout.rs +++ b/packages/shared/src/utils/timeout.rs @@ -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,