From 471565e3600923cd0574e3c0f81ac6acc6c9a4b3 Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Sat, 2 May 2020 18:52:49 -0400 Subject: [PATCH] fix: add new event manager to ctx in handlers (#485) --- x/cdp/handler.go | 1 + x/kavadist/handler.go | 1 + x/pricefeed/handler.go | 1 + 3 files changed, 3 insertions(+) diff --git a/x/cdp/handler.go b/x/cdp/handler.go index 6833a9c0..debe54eb 100644 --- a/x/cdp/handler.go +++ b/x/cdp/handler.go @@ -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) diff --git a/x/kavadist/handler.go b/x/kavadist/handler.go index ed7a1b60..6d093bfd 100644 --- a/x/kavadist/handler.go +++ b/x/kavadist/handler.go @@ -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) diff --git a/x/pricefeed/handler.go b/x/pricefeed/handler.go index c43277e3..39514112 100644 --- a/x/pricefeed/handler.go +++ b/x/pricefeed/handler.go @@ -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)