fix: add new event manager to ctx in handlers (#485)

This commit is contained in:
Kevin Davis 2020-05-02 18:52:49 -04:00 committed by GitHub
parent 8f3858509a
commit 471565e360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import (
// NewHandler creates an sdk.Handler for cdp messages
func NewHandler(k Keeper) sdk.Handler {
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
ctx = ctx.WithEventManager(sdk.NewEventManager())
switch msg := msg.(type) {
case MsgCreateCDP:
return handleMsgCreateCDP(ctx, k, msg)

View File

@ -8,6 +8,7 @@ import (
// NewHandler creates an sdk.Handler for kavadist messages
func NewHandler(k Keeper) sdk.Handler {
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
ctx = ctx.WithEventManager(sdk.NewEventManager())
switch msg := msg.(type) {
default:
return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", ModuleName, msg)

View File

@ -8,6 +8,7 @@ import (
// NewHandler handles all pricefeed type messages
func NewHandler(k Keeper) sdk.Handler {
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
ctx = ctx.WithEventManager(sdk.NewEventManager())
switch msg := msg.(type) {
case MsgPostPrice:
return HandleMsgPostPrice(ctx, k, msg)