diff --git a/x/iscn/handler.go b/x/iscn/handler.go deleted file mode 100644 index 19d33b155..000000000 --- a/x/iscn/handler.go +++ /dev/null @@ -1,29 +0,0 @@ -package iscn - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/likecoin/likecoin-chain/v4/x/iscn/keeper" - "github.com/likecoin/likecoin-chain/v4/x/iscn/types" -) - -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - switch msg := msg.(type) { - case *types.MsgCreateIscnRecord: - res, err := msgServer.CreateIscnRecord(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUpdateIscnRecord: - res, err := msgServer.UpdateIscnRecord(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgChangeIscnRecordOwnership: - res, err := msgServer.ChangeIscnRecordOwnership(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized iscn message type: %T", msg) - } - } -} diff --git a/x/iscn/module.go b/x/iscn/module.go index 678ca57c8..615d3484b 100644 --- a/x/iscn/module.go +++ b/x/iscn/module.go @@ -98,9 +98,7 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { keeper.RegisterInvariants(ir, am.keeper) } -func (am AppModule) Route() sdk.Route { - return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) -} +func (am AppModule) Route() sdk.Route { return sdk.Route{} } func (AppModule) QuerierRoute() string { return types.QuerierRoute diff --git a/x/likenft/handler.go b/x/likenft/handler.go deleted file mode 100644 index 01eda08b7..000000000 --- a/x/likenft/handler.go +++ /dev/null @@ -1,80 +0,0 @@ -package likenft - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/likecoin/likecoin-chain/v4/x/likenft/keeper" - "github.com/likecoin/likecoin-chain/v4/x/likenft/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgNewClass: - res, err := msgServer.NewClass(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUpdateClass: - res, err := msgServer.UpdateClass(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgMintNFT: - res, err := msgServer.MintNFT(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgBurnNFT: - res, err := msgServer.BurnNFT(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCreateBlindBoxContent: - res, err := msgServer.CreateBlindBoxContent(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUpdateBlindBoxContent: - res, err := msgServer.UpdateBlindBoxContent(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgDeleteBlindBoxContent: - res, err := msgServer.DeleteBlindBoxContent(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCreateOffer: - res, err := msgServer.CreateOffer(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUpdateOffer: - res, err := msgServer.UpdateOffer(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgDeleteOffer: - res, err := msgServer.DeleteOffer(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCreateListing: - res, err := msgServer.CreateListing(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUpdateListing: - res, err := msgServer.UpdateListing(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgDeleteListing: - res, err := msgServer.DeleteListing(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgSellNFT: - res, err := msgServer.SellNFT(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgBuyNFT: - res, err := msgServer.BuyNFT(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCreateRoyaltyConfig: - res, err := msgServer.CreateRoyaltyConfig(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUpdateRoyaltyConfig: - res, err := msgServer.UpdateRoyaltyConfig(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgDeleteRoyaltyConfig: - res, err := msgServer.DeleteRoyaltyConfig(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/likenft/module.go b/x/likenft/module.go index 911af0329..57ad724b5 100644 --- a/x/likenft/module.go +++ b/x/likenft/module.go @@ -123,9 +123,7 @@ func (am AppModule) Name() string { } // Route returns the capability module's message routing key. -func (am AppModule) Route() sdk.Route { - return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) -} +func (am AppModule) Route() sdk.Route { return sdk.Route{} } // QuerierRoute returns the capability module's query routing key. func (AppModule) QuerierRoute() string { return types.QuerierRoute }