mirror of
https://github.com/0glabs/0g-chain.git
synced 2025-01-12 16:25:17 +00:00
fix: add new event manager to ctx in handlers (#485)
This commit is contained in:
parent
8f3858509a
commit
471565e360
@ -8,6 +8,7 @@ import (
|
|||||||
// NewHandler creates an sdk.Handler for cdp messages
|
// NewHandler creates an sdk.Handler for cdp messages
|
||||||
func NewHandler(k Keeper) sdk.Handler {
|
func NewHandler(k Keeper) sdk.Handler {
|
||||||
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
|
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
|
||||||
|
ctx = ctx.WithEventManager(sdk.NewEventManager())
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case MsgCreateCDP:
|
case MsgCreateCDP:
|
||||||
return handleMsgCreateCDP(ctx, k, msg)
|
return handleMsgCreateCDP(ctx, k, msg)
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
// NewHandler creates an sdk.Handler for kavadist messages
|
// NewHandler creates an sdk.Handler for kavadist messages
|
||||||
func NewHandler(k Keeper) sdk.Handler {
|
func NewHandler(k Keeper) sdk.Handler {
|
||||||
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
|
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
|
||||||
|
ctx = ctx.WithEventManager(sdk.NewEventManager())
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
default:
|
default:
|
||||||
return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", ModuleName, msg)
|
return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", ModuleName, msg)
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
// NewHandler handles all pricefeed type messages
|
// NewHandler handles all pricefeed type messages
|
||||||
func NewHandler(k Keeper) sdk.Handler {
|
func NewHandler(k Keeper) sdk.Handler {
|
||||||
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
|
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
|
||||||
|
ctx = ctx.WithEventManager(sdk.NewEventManager())
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case MsgPostPrice:
|
case MsgPostPrice:
|
||||||
return HandleMsgPostPrice(ctx, k, msg)
|
return HandleMsgPostPrice(ctx, k, msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user