From 67029d4600a34960c5a48f58a45d457b73b0f915 Mon Sep 17 00:00:00 2001 From: GnaD <89174180+GNaD13@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:19:53 +0700 Subject: [PATCH] fix: Fix bug with cmd query (#112) * change cmd query * add query server --- x/multi-staking/module.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/x/multi-staking/module.go b/x/multi-staking/module.go index 5a319627..aafe104b 100644 --- a/x/multi-staking/module.go +++ b/x/multi-staking/module.go @@ -71,13 +71,11 @@ func (AppModuleBasic) GetTxCmd() *cobra.Command { } // GetQueryCmd returns the multi-staking and staking module's root query command. -func (AppModuleBasic) GetQueryCmd() (queryCmd *cobra.Command) { - queryCmd.AddCommand( - stakingcli.GetQueryCmd(), - cli.GetQueryCmd(), - ) +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + cmd := stakingcli.GetQueryCmd() + cmd.AddCommand(cli.GetQueryCmd()) - return queryCmd + return cmd } // AppModule embeds the Cosmos SDK's x/staking AppModule where we only override @@ -138,6 +136,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd func (am AppModule) RegisterServices(cfg module.Configurator) { stakingtypes.RegisterMsgServer(cfg.MsgServer(), multistakingkeeper.NewMsgServerImpl(am.keeper)) multistakingtypes.RegisterQueryServer(cfg.QueryServer(), multistakingkeeper.NewQueryServerImpl(am.keeper)) + + querier := stakingkeeper.Querier{Keeper: am.sk} + stakingtypes.RegisterQueryServer(cfg.QueryServer(), querier) } // InitGenesis initial genesis state for feeabs module