diff --git a/x/crosschain/handler.go b/x/crosschain/handler.go deleted file mode 100644 index db3af28142..0000000000 --- a/x/crosschain/handler.go +++ /dev/null @@ -1,56 +0,0 @@ -package crosschain - -import ( - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/zeta-chain/zetacore/x/crosschain/keeper" - "github.com/zeta-chain/zetacore/x/crosschain/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.MsgAddToOutTxTracker: - res, err := msgServer.AddToOutTxTracker(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgRemoveFromOutTxTracker: - res, err := msgServer.RemoveFromOutTxTracker(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCreateTSSVoter: - res, err := msgServer.CreateTSSVoter(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgGasPriceVoter: - res, err := msgServer.GasPriceVoter(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgNonceVoter: - res, err := msgServer.NonceVoter(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgVoteOnObservedOutboundTx: - res, err := msgServer.VoteOnObservedOutboundTx(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgVoteOnObservedInboundTx: - res, err := msgServer.VoteOnObservedInboundTx(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgSetNodeKeys: - res, err := msgServer.SetNodeKeys(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUpdatePermissionFlags: - res, err := msgServer.UpdatePermissionFlags(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/crosschain/module.go b/x/crosschain/module.go index 0b79e2275e..5a9948c87d 100644 --- a/x/crosschain/module.go +++ b/x/crosschain/module.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -130,7 +131,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)) + return sdk.Route{} } // QuerierRoute returns the capability module's query routing key. diff --git a/x/emissions/handler.go b/x/emissions/handler.go deleted file mode 100644 index 58e0ae36d6..0000000000 --- a/x/emissions/handler.go +++ /dev/null @@ -1,23 +0,0 @@ -package emissions - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/zeta-chain/zetacore/x/emissions/keeper" - "github.com/zeta-chain/zetacore/x/emissions/types" -) - -func NewHandler(k keeper.Keeper, bk types.BankKeeper) sdk.Handler { - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - // 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/emissions/module.go b/x/emissions/module.go index 824fd7721d..90f2f3dd3c 100644 --- a/x/emissions/module.go +++ b/x/emissions/module.go @@ -3,6 +3,7 @@ package emissions import ( "encoding/json" "fmt" + // this line is used by starport scaffolding # 1 "github.com/gorilla/mux" @@ -127,7 +128,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, am.bankKeeper)) + return sdk.Route{} } // QuerierRoute returns the capability module's query routing key. diff --git a/x/fungible/handler.go b/x/fungible/handler.go deleted file mode 100644 index d7c1298bf8..0000000000 --- a/x/fungible/handler.go +++ /dev/null @@ -1,33 +0,0 @@ -package fungible - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/zeta-chain/zetacore/x/fungible/keeper" - "github.com/zeta-chain/zetacore/x/fungible/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.MsgDeployFungibleCoinZRC20: - res, err := msgServer.DeployFungibleCoinZRC20(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgRemoveForeignCoin: - res, err := msgServer.RemoveForeignCoin(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/fungible/module.go b/x/fungible/module.go index 8a01290575..cd87149c2e 100644 --- a/x/fungible/module.go +++ b/x/fungible/module.go @@ -127,7 +127,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)) + return sdk.Route{} } // QuerierRoute returns the capability module's query routing key. diff --git a/x/observer/handler.go b/x/observer/handler.go deleted file mode 100644 index 4d23ab85c0..0000000000 --- a/x/observer/handler.go +++ /dev/null @@ -1,32 +0,0 @@ -package observer - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/zeta-chain/zetacore/x/observer/keeper" - "github.com/zeta-chain/zetacore/x/observer/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - // this line is used by starport scaffolding # handler/msgServer - 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.MsgSetSupportedChains: - // res, err := msgServer.SetSupportedChains(sdk.WrapSDKContext(ctx), msg) - // return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgAddObserver: - res, err := msgServer.AddObserver(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/observer/module.go b/x/observer/module.go index e5e3f53fad..6b93361f35 100644 --- a/x/observer/module.go +++ b/x/observer/module.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + // this line is used by starport scaffolding # 1 "github.com/gorilla/mux" @@ -128,7 +129,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)) + return sdk.Route{} } // QuerierRoute returns the capability module's query routing key. diff --git a/x/observer/types/tmp.json b/x/observer/types/tmp.json deleted file mode 100644 index 19f6d56172..0000000000 --- a/x/observer/types/tmp.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "SupportedChainsList": [ - 1337, - 18444, - 101 - ], - "ObserverAddress": "cosmos1jtkmr875jh9fvj2am6vnf54eqtcwxyu0gaptwz", - "ObserverGranteeAddress": "cosmos1h5vgfy5ytyqc9vpx0vxjswqw0hezwrxguq6za7", - "StakingGranteeAddress": "cosmos1h5vgfy5ytyqc9vpx0vxjswqw0hezwrxguq6za7", - "StakingMaxTokens": "100000000", - "StakingValidatorAllowList": [ - "cosmosvaloper1tfzf7z4ccu338u7t0wemhy793kfla6kyx2rge8" - ], - "SpendMaxTokens": "100000000" - } -] \ No newline at end of file