From 5ae8860437ce95ccee9c09eb594cd00bd23e5cc8 Mon Sep 17 00:00:00 2001 From: Farhad Shabani Date: Tue, 22 Oct 2024 05:39:14 -0700 Subject: [PATCH] imp: relax timeout check in MsgTransfer conversions (#1363) --- .../1362-relax-timeout-check-in-MsgTransfer-conversions.md | 2 ++ ibc-apps/ics20-transfer/types/src/msgs/transfer.rs | 7 ------- ibc-apps/ics721-nft-transfer/types/src/msgs/transfer.rs | 7 ------- 3 files changed, 2 insertions(+), 14 deletions(-) create mode 100644 .changelog/unreleased/improvements/1362-relax-timeout-check-in-MsgTransfer-conversions.md diff --git a/.changelog/unreleased/improvements/1362-relax-timeout-check-in-MsgTransfer-conversions.md b/.changelog/unreleased/improvements/1362-relax-timeout-check-in-MsgTransfer-conversions.md new file mode 100644 index 000000000..e2fa072f7 --- /dev/null +++ b/.changelog/unreleased/improvements/1362-relax-timeout-check-in-MsgTransfer-conversions.md @@ -0,0 +1,2 @@ +- [ibc-apps] Relax timeout check during `MsgTransfer` proto to domain + conversions ([#1362](https://github.com/cosmos/ibc-rs/issues/1362)). diff --git a/ibc-apps/ics20-transfer/types/src/msgs/transfer.rs b/ibc-apps/ics20-transfer/types/src/msgs/transfer.rs index a337b2b51..4f822b5a6 100644 --- a/ibc-apps/ics20-transfer/types/src/msgs/transfer.rs +++ b/ibc-apps/ics20-transfer/types/src/msgs/transfer.rs @@ -52,13 +52,6 @@ impl TryFrom for MsgTransfer { let timeout_height_on_b: TimeoutHeight = raw_msg.timeout_height.try_into()?; let timeout_timestamp_on_b: TimeoutTimestamp = raw_msg.timeout_timestamp.into(); - // Packet timeout height and packet timeout timestamp cannot both be unset. - if !timeout_height_on_b.is_set() && !timeout_timestamp_on_b.is_set() { - return Err(DecodingError::missing_raw_data( - "msg transfer timeout height or timeout timestamp", - )); - } - Ok(MsgTransfer { port_id_on_a: raw_msg.source_port.parse()?, chan_id_on_a: raw_msg.source_channel.parse()?, diff --git a/ibc-apps/ics721-nft-transfer/types/src/msgs/transfer.rs b/ibc-apps/ics721-nft-transfer/types/src/msgs/transfer.rs index 97fa5b415..0ced7dbac 100644 --- a/ibc-apps/ics721-nft-transfer/types/src/msgs/transfer.rs +++ b/ibc-apps/ics721-nft-transfer/types/src/msgs/transfer.rs @@ -52,13 +52,6 @@ impl TryFrom for MsgTransfer { let timeout_height_on_b: TimeoutHeight = raw_msg.timeout_height.try_into()?; let timeout_timestamp_on_b: TimeoutTimestamp = raw_msg.timeout_timestamp.into(); - // Packet timeout height and packet timeout timestamp cannot both be unset. - if !timeout_height_on_b.is_set() && !timeout_timestamp_on_b.is_set() { - return Err(DecodingError::missing_raw_data( - "missing timeout height or timeout timestamp", - )); - } - let memo = if raw_msg.memo.is_empty() { None } else {