Skip to content

Commit

Permalink
Merge pull request #1069 from scrtlabs/lior-update-wasmd-028
Browse files Browse the repository at this point in the history
Lior update wasmd 028
  • Loading branch information
assafmo authored Aug 17, 2022
2 parents 4ab681d + 7e648bb commit 2977d7d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions x/compute/internal/keeper/msg_dispatcher.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package keeper

import (
"bytes"
"encoding/json"
"fmt"
"sort"
"strings"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -204,6 +206,17 @@ func (d MessageDispatcher) DispatchSubmessages(ctx sdk.Context, contractAddr sdk
commit()
filteredEvents = filterEvents(append(em.Events(), events...))
ctx.EventManager().EmitEvents(filteredEvents)

if msg.Msg.Wasm == nil {
filteredEvents = []sdk.Event{}
} else {
for _, e := range filteredEvents {
attributes := e.Attributes
sort.SliceStable(attributes, func(i, j int) bool {
return bytes.Compare(attributes[i].Key, attributes[j].Key) < 0
})
}
}
} // on failure, revert state from sandbox, and ignore events (just skip doing the above)

// we only callback if requested. Short-circuit here the cases we don't want to
Expand Down

0 comments on commit 2977d7d

Please sign in to comment.