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

Filter channel id #38

Merged
merged 3 commits into from
Mar 28, 2024
Merged
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
9 changes: 9 additions & 0 deletions pkg/relay/ethereum/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ func (chain *Chain) findSentPackets(ctx core.QueryContext, fromHeight uint64) (c
if err != nil {
return nil, fmt.Errorf("failed to parse SendPacket event: err=%v, log=%v", err, log)
}
if sendPacket.SourceChannel != chain.Path().ChannelID || sendPacket.SourcePort != chain.Path().PortID {
continue
}
siburu marked this conversation as resolved.
Show resolved Hide resolved

packet := &core.PacketInfo{
Packet: channeltypes.NewPacket(
Expand Down Expand Up @@ -160,6 +163,9 @@ func (chain *Chain) findRecvPacketEvents(ctx core.QueryContext, fromHeight uint6
if err != nil {
return nil, fmt.Errorf("failed to parse RecvPacket event: err=%v, log=%v", err, log)
}
if event.Packet.DestinationChannel != chain.Path().ChannelID || event.Packet.DestinationPort != chain.Path().PortID {
continue
}
events = append(events, event)
}

Expand All @@ -177,6 +183,9 @@ func (chain *Chain) findWriteAckEvents(ctx core.QueryContext, fromHeight uint64)
if err != nil {
return nil, fmt.Errorf("failed to parse WriteAcknowledgement event: err=%v, log=%v", err, log)
}
if event.DestinationChannel != chain.Path().ChannelID || event.DestinationPortId != chain.Path().PortID {
continue
}
events = append(events, event)
}

Expand Down