Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MsgTimeout verfication #71

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading