Don't pass non-wasm events to reply()

Output events are not part of consensus and can be non-deterministic
This commit is contained in:
Assaf Morami
2022-07-28 12:52:06 +03:00
parent d63bea442b
commit ee44cc06d0

View File

@@ -107,6 +107,9 @@ 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{}
}
} // 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