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

Chore: keep dex message evts [NTRN-439] #277

Open
wants to merge 2 commits into
base: neutron
Choose a base branch
from
Open
Changes from 1 commit
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
13 changes: 12 additions & 1 deletion x/wasm/keeper/msg_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,23 @@ func isIBCEvent(event sdk.Event) bool {
return false
}

func isDexEvent(event sdk.Event) bool {
for _, attr := range event.Attributes {
// Indexing of dex events requires that all dev events are emitted
if attr.Key == sdk.AttributeKeyModule && attr.Value == "dex" {
return true
}
}
return false
}

func filterEvents(events []sdk.Event) []sdk.Event {
// pre-allocate space for efficiency
res := make([]sdk.Event, 0, len(events))
for _, ev := range events {
// we filter out all 'message' type events but if they are ibc events we must keep them for the IBC relayer (hermes particularly)
if ev.Type != "message" || isIBCEvent(ev) {
// we also keep dex events, this is required for proper indexing of dex messages
if ev.Type != "message" || isIBCEvent(ev) || isDexEvent(ev) {
res = append(res, ev)
}
}
Expand Down
Loading