Skip to content

Commit

Permalink
feat: typed events (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: jtieri <[email protected]>
  • Loading branch information
fadeev and jtieri authored Nov 9, 2022
1 parent 2a2d61a commit ce5cac0
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 13 deletions.
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_blacklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ func (k msgServer) Blacklist(goCtx context.Context, msg *types.MsgBlacklist) (*t

k.SetBlacklisted(ctx, blacklisted)

return &types.MsgBlacklistResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgBlacklistResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_burn.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ func (k msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBu
return nil, sdkerrors.Wrap(types.ErrBurn, err.Error())
}

return &types.MsgBurnResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgBurnResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_change_admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ func (k msgServer) ChangeAdmin(goCtx context.Context, msg *types.MsgChangeAdmin)

k.SetAdmin(ctx, admin)

return &types.MsgChangeAdminResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgChangeAdminResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_configure_minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@ func (k msgServer) ConfigureMinter(goCtx context.Context, msg *types.MsgConfigur
Allowance: msg.Allowance,
})

return &types.MsgConfigureMinterResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgConfigureMinterResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,7 @@ func (k msgServer) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMi
return nil, sdkerrors.Wrap(types.ErrSendCoinsToAccount, err.Error())
}

return &types.MsgMintResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgMintResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ func (k msgServer) Pause(goCtx context.Context, msg *types.MsgPause) (*types.Msg

k.SetPaused(ctx, paused)

return &types.MsgPauseResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgPauseResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_remove_minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ func (k msgServer) RemoveMinter(goCtx context.Context, msg *types.MsgRemoveMinte

k.RemoveMinters(ctx, minter.Address)

return &types.MsgRemoveMinterResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgRemoveMinterResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_unblacklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ func (k msgServer) Unblacklist(goCtx context.Context, msg *types.MsgUnblacklist)

k.RemoveBlacklisted(ctx, blacklisted.Address)

return &types.MsgUnblacklistResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgUnblacklistResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_unpause.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ func (k msgServer) Unpause(goCtx context.Context, msg *types.MsgUnpause) (*types

k.SetPaused(ctx, paused)

return &types.MsgUnpauseResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgUnpauseResponse{}, err
}
5 changes: 4 additions & 1 deletion x/tokenfactory/keeper/msg_server_update_blacklister.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ func (k msgServer) UpdateBlacklister(goCtx context.Context, msg *types.MsgUpdate
}

k.SetBlacklister(ctx, blacklister)
return &types.MsgUpdateBlacklisterResponse{}, nil

err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgUpdateBlacklisterResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_update_master_minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ func (k msgServer) UpdateMasterMinter(goCtx context.Context, msg *types.MsgUpdat

k.SetMasterMinter(ctx, masterMinter)

return &types.MsgUpdateMasterMinterResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgUpdateMasterMinterResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_update_owner.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ func (k msgServer) UpdateOwner(goCtx context.Context, msg *types.MsgUpdateOwner)

k.SetOwner(ctx, owner)

return &types.MsgUpdateOwnerResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgUpdateOwnerResponse{}, err
}
4 changes: 3 additions & 1 deletion x/tokenfactory/keeper/msg_server_update_pauser.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ func (k msgServer) UpdatePauser(goCtx context.Context, msg *types.MsgUpdatePause

k.SetPauser(ctx, pauser)

return &types.MsgUpdatePauserResponse{}, nil
err := ctx.EventManager().EmitTypedEvent(msg)

return &types.MsgUpdatePauserResponse{}, err
}

0 comments on commit ce5cac0

Please sign in to comment.