Skip to content

Commit

Permalink
fix(voyager): recv/writeAck require src to be read on counterparty
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-aitlahcen committed Jan 11, 2025
1 parent 33dd538 commit ffaccac
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions voyager/plugins/event-source/cosmos-sdk/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1600,18 +1600,6 @@ impl PluginServer<ModuleCall, ModuleCallback> for Module {
IbcEvent::UnionRecvPacket(recv_packet) => {
let packet = recv_packet.packet;

let source_channel = voyager_client
.query_ibc_state(
self.chain_id.clone(),
QueryHeight::Specific(height),
ibc_union_spec::ChannelPath {
channel_id: packet.source_channel,
},
)
.await?
.state
.unwrap();

let destination_channel = voyager_client
.query_ibc_state(
self.chain_id.clone(),
Expand Down Expand Up @@ -1651,6 +1639,18 @@ impl PluginServer<ModuleCall, ModuleCallback> for Module {
)
.await?;

let source_channel = voyager_client
.query_ibc_state(
client_meta.chain_id.clone(),
QueryHeight::Specific(height),
ibc_union_spec::ChannelPath {
channel_id: packet.source_channel,
},
)
.await?
.state
.unwrap();

let event = ibc_union_spec::PacketRecv {
packet_data: packet.data.into(),
packet: ibc_union_spec::PacketMetadata {
Expand Down Expand Up @@ -1694,18 +1694,6 @@ impl PluginServer<ModuleCall, ModuleCallback> for Module {
IbcEvent::UnionWriteAck(write_ack) => {
let packet = write_ack.packet;

let source_channel = voyager_client
.query_ibc_state(
self.chain_id.clone(),
QueryHeight::Specific(height),
ibc_union_spec::ChannelPath {
channel_id: packet.source_channel,
},
)
.await?
.state
.unwrap();

let destination_channel = voyager_client
.query_ibc_state(
self.chain_id.clone(),
Expand Down Expand Up @@ -1745,6 +1733,18 @@ impl PluginServer<ModuleCall, ModuleCallback> for Module {
)
.await?;

let source_channel = voyager_client
.query_ibc_state(
client_meta.chain_id.clone(),
QueryHeight::Specific(height),
ibc_union_spec::ChannelPath {
channel_id: packet.source_channel,
},
)
.await?
.state
.unwrap();

let event = ibc_union_spec::WriteAck {
packet_data: packet.data.into(),
packet: ibc_union_spec::PacketMetadata {
Expand Down

0 comments on commit ffaccac

Please sign in to comment.