diff --git a/voyager/plugins/event-source/cosmos-sdk/src/main.rs b/voyager/plugins/event-source/cosmos-sdk/src/main.rs index 37eb0d6389..ed726c353b 100644 --- a/voyager/plugins/event-source/cosmos-sdk/src/main.rs +++ b/voyager/plugins/event-source/cosmos-sdk/src/main.rs @@ -1600,18 +1600,6 @@ impl PluginServer 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(), @@ -1651,6 +1639,18 @@ impl PluginServer 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 { @@ -1694,18 +1694,6 @@ impl PluginServer 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(), @@ -1745,6 +1733,18 @@ impl PluginServer 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 {