Skip to content

Commit

Permalink
Fix MsgTimeout verfication
Browse files Browse the repository at this point in the history
  • Loading branch information
en committed Dec 11, 2023
1 parent 6e2214d commit 76fa10c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions crates/ibc/src/core/ics04_channel/handler/timeout.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::prelude::*;
use prost::Message;
// use prost::Message;

use crate::core::events::IbcEvent;
use crate::core::events::MessageEvent;
Expand Down Expand Up @@ -232,12 +232,16 @@ where
let seq_recv_path_on_b =
SeqRecvPath::new(&msg.packet.port_id_on_b, &msg.packet.chan_id_on_b);

let mut value = Vec::new();
u64::from(msg.packet.seq_on_a)
.encode(&mut value)
.map_err(|_| PacketError::CannotEncodeSequence {
sequence: msg.packet.seq_on_a,
})?;
// let mut value = Vec::new();
// u64::from(msg.packet.seq_on_a)
// .encode(&mut value)
// .map_err(|_| PacketError::CannotEncodeSequence {
// sequence: msg.packet.seq_on_a,
// })?;

// Note: We expect the return to be a u64 encoded in big-endian. Refer to ibc-go:
// https://github.com/cosmos/ibc-go/blob/25767f6bdb5bab2c2a116b41d92d753c93e18121/modules/core/04-channel/client/utils/utils.go#L191
let value = u64::from(msg.packet.seq_on_a).to_be_bytes().to_vec();

client_state_of_b_on_a.verify_membership(
conn_end_on_a.counterparty().prefix(),
Expand Down

0 comments on commit 76fa10c

Please sign in to comment.